mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
Merge pull request 'Patch/hotfix/v8.2.1' (#53) from fix/patch-hotfix-8.2.1-r1 into hotfix/v8.2.1
This commit is contained in:
@ -78,7 +78,7 @@ public slots:
|
||||
virtual void onWebTitleChanged(int, std::wstring json) = 0;
|
||||
virtual void onWebAppsFeatures(int, std::wstring) = 0;
|
||||
virtual void onReporterMode(int, bool);
|
||||
virtual void onImageLoadFinished(void* fdl, int err) = 0;
|
||||
virtual void onImageLoadFinished(int err) = 0;
|
||||
virtual void onErrorPage(int id, const std::wstring& action);
|
||||
};
|
||||
|
||||
|
||||
@ -115,6 +115,7 @@ class CEditorWindowPrivate : public CCefEventsGate
|
||||
QPixmap avatar;
|
||||
|
||||
QMap<QString, CSVGPushButton*> m_mapTitleButtons;
|
||||
CFileDownloader *fdl = nullptr;
|
||||
int leftBtnsCount = DEFAULT_BTNS_COUNT;
|
||||
|
||||
enum LayoutType {
|
||||
@ -131,6 +132,8 @@ public:
|
||||
~CEditorWindowPrivate() override {
|
||||
if ( leftboxbuttons )
|
||||
leftboxbuttons->deleteLater();
|
||||
if (fdl)
|
||||
delete fdl, fdl = nullptr;
|
||||
}
|
||||
|
||||
void createHomeButton() {
|
||||
@ -298,16 +301,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void onImageLoadFinished(void* fdl, int err) override
|
||||
virtual void onImageLoadFinished(int err) override
|
||||
{
|
||||
CFileDownloader *_fdl = (CFileDownloader*)fdl;
|
||||
if (err == 0) {
|
||||
QString path = QString::fromStdWString(_fdl->GetFilePath());
|
||||
QString path = QString::fromStdWString(fdl->GetFilePath());
|
||||
if (!(avatar = QPixmap(path)).isNull())
|
||||
iconuser->setPixmap(rounded_pixmap(avatar, iconuser->width()));
|
||||
QFile::remove(path);
|
||||
}
|
||||
delete _fdl;
|
||||
}
|
||||
|
||||
void onEditorConfig(int, std::wstring cfg) override
|
||||
@ -349,12 +350,16 @@ public:
|
||||
iconuser->setPixmap(rounded_pixmap(avatar, iconuser->width()));
|
||||
}
|
||||
} else {
|
||||
QString tmp_name = QString("/avatar_%1.png").arg(QUuid::createUuid().toString().remove('{').remove('}'));
|
||||
CFileDownloader *fdl = new CFileDownloader(img_url.toStdWString(), false);
|
||||
fdl->SetFilePath((QDir::tempPath() + tmp_name).toStdWString());
|
||||
fdl->SetEvent_OnComplete([=](int err) {
|
||||
QMetaObject::invokeMethod(this, "onImageLoadFinished", Qt::QueuedConnection, Q_ARG(void*, fdl), Q_ARG(int, err));
|
||||
});
|
||||
if (!fdl) {
|
||||
QString tmp_name = QString("/avatar_%1.png").arg(QUuid::createUuid().toString().remove('{').remove('}'));
|
||||
fdl = new CFileDownloader(img_url.toStdWString(), false);
|
||||
fdl->SetFilePath((QDir::tempPath() + tmp_name).toStdWString());
|
||||
fdl->SetEvent_OnComplete([=](int err) {
|
||||
QMetaObject::invokeMethod(this, "onImageLoadFinished", Qt::QueuedConnection, Q_ARG(int, err));
|
||||
});
|
||||
} else {
|
||||
fdl->Cancel();
|
||||
}
|
||||
fdl->Start(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -762,7 +762,7 @@ void CMainWindow::onPortalUITheme(int viewid, const std::wstring& json)
|
||||
{
|
||||
if ( !json.empty() ) {
|
||||
int index = m_pTabs->tabIndexByView(viewid);
|
||||
if (m_pTabs->panel(index)->data()->isViewType(cvwtEditor))
|
||||
if (index < 0 || m_pTabs->panel(index)->data()->isViewType(cvwtEditor))
|
||||
return;
|
||||
|
||||
if ( json.rfind(L"default-", 0) == 0 ) {
|
||||
|
||||
Reference in New Issue
Block a user