Skip to content

Commit 1047553

Browse files
[win-linux] update JumpList Recent only after document load completion
1 parent 9312056 commit 1047553

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

win-linux/src/cascapplicationmanagerwrapper.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,6 @@ void CAscApplicationManagerWrapper::handleInputCmd(const std::vector<wstring>& v
10151015
if ( _c_pos != std::wstring::npos )
10161016
open_opts.name = QString::fromStdWString(open_opts.wurl.substr(++_c_pos));
10171017

1018-
Utils::addToRecent(open_opts.wurl);
10191018
// open_opts.srctype = etLocalFile;
10201019
} else
10211020
if ( _error == EBADF && !open_in_new_window ) {
@@ -1133,8 +1132,24 @@ void CAscApplicationManagerWrapper::onDocumentReady(int uid)
11331132
Association::instance().chekForAssociations(uid);
11341133
#endif
11351134

1136-
if (uid > -1 && printData().printerCapabilitiesReady())
1137-
AscAppManager::sendCommandTo(GetViewById(uid), L"printer:config", printData().getPrinterCapabilitiesJson().toStdWString());
1135+
if (uid > -1) {
1136+
if (printData().printerCapabilitiesReady())
1137+
AscAppManager::sendCommandTo(GetViewById(uid), L"printer:config", printData().getPrinterCapabilitiesJson().toStdWString());
1138+
1139+
CAscTabData *data = nullptr;
1140+
if (CEditorWindow *editor = editorWindowFromViewId(uid)) {
1141+
data = editor->mainView()->data();
1142+
} else
1143+
if (mainWindow() && mainWindow()->holdView(uid)) {
1144+
int indx = mainWindow()->tabWidget()->tabIndexByView(uid);
1145+
if (indx > -1)
1146+
data = mainWindow()->tabWidget()->panel(indx)->data();
1147+
}
1148+
1149+
if (data && data->isLocal() && !data->url().empty()) {
1150+
Utils::addToRecent(data->url());
1151+
}
1152+
}
11381153

11391154
static bool check_printers = false;
11401155
if (!check_printers) {

win-linux/src/cascapplicationmanagerwrapper_private.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ class CAscApplicationManagerWrapper_Private
325325
CMessage::error(m_appmanager.mainWindow()->handle(),
326326
QObject::tr("File %1 cannot be opened or doesn't exists.").arg(_info.fileName()));
327327
}
328-
else Utils::addToRecent(file_path);
329328
}
330329

331330
return true;

win-linux/src/components/cdownloadwidget.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ void CDownloadWidget::downloadProcess(void * info)
349349
Utils::openUrl(QUrl::fromLocalFile(path).toString());
350350
} else {
351351
AscAppManager::handleInputCmd({path.toStdWString()});
352-
Utils::addToRecent(path.toStdWString());
353352
}
354353
});
355354

win-linux/src/windows/cmainwindow.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,6 @@ void CMainWindow::doOpenLocalFile(COpenOptions& opts)
956956
int result = m_pTabs->openLocalDocument(opts, true);
957957
if ( !(result < 0) ) {
958958
toggleButtonMain(false, true);
959-
Utils::addToRecent(opts.wurl);
960959
} else
961960
if (result == -255) {
962961
QTimer::singleShot(0, this, [=] {

0 commit comments

Comments
 (0)