Skip to content

Commit c57ecd0

Browse files
author
Oleg Kozhukharenko
committed
Merge pull request 'Fix bug 68628' (#484) from fix/bug-68628 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/desktop-apps/pulls/484
2 parents 0570560 + 1047553 commit c57ecd0

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

win-linux/extras/projicons/src/jumplist.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ HRESULT _CreateShellLink(PCWSTR pszArguments, PCWSTR pszTitle, IShellLink **ppsl
101101

102102
HRESULT _AddTasksToList(ICustomDestinationList *pcdl, const QStringList &list)
103103
{
104-
pcdl->AppendKnownCategory(KDC_RECENT);
105104
IObjectCollection *poc;
106-
HRESULT hr = CoCreateInstance(CLSID_EnumerableObjectCollection, NULL, CLSCTX_INPROC, IID_PPV_ARGS(&poc));
105+
HRESULT hr = CoCreateInstance(CLSID_EnumerableObjectCollection, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&poc));
107106
if (SUCCEEDED(hr))
108107
{
109108
PCWSTR args[MAX_TASK_NUM] = {

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)