Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Setting "Open folder window in separate process" to check/uncheck is opposite to the actual situation #2100

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/apps/dde-file-manager/commandparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ void CommandParser::openInHomeDirectory()
{
QString homePath = StandardPaths::location(StandardPaths::StandardLocation::kHomePath);
QUrl url = QUrl::fromUserInput(homePath);
auto flag = !DConfigManager::instance()->
auto flag = DConfigManager::instance()->
value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess, false).toBool();
kOpenFolderWindowsInASeparateProcess, true).toBool();
dpfSignalDispatcher->publish(GlobalEventType::kOpenNewWindow, url, flag);
}

Expand Down Expand Up @@ -298,9 +298,9 @@ void CommandParser::openInUrls()
argumentUrls.append(url);
}
if (argumentUrls.isEmpty()) {
auto flag = !DConfigManager::instance()->
auto flag = DConfigManager::instance()->
value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess, false).toBool();
kOpenFolderWindowsInASeparateProcess, true).toBool();
dpfSignalDispatcher->publish(GlobalEventType::kOpenNewWindow, QUrl(), flag);
}
for (const QUrl &url : argumentUrls)
Expand All @@ -321,9 +321,9 @@ void CommandParser::openWindowWithUrl(const QUrl &url)
dpfSignalDispatcher->publish(GlobalEventType::kLoadPlugins, QStringList() << name);
});
}
auto flag = DConfigManager::instance()->
auto flag = !DConfigManager::instance()->
value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess, false).toBool();
kOpenFolderWindowsInASeparateProcess, true).toBool();
flag = flag ? false : isSet("n") || isSet("s") || isSet("sessionfile");
dpfSignalDispatcher->publish(GlobalEventType::kOpenNewWindow, url, flag);
}
Expand Down
4 changes: 2 additions & 2 deletions src/dfm-base/base/configs/settingbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@ void SettingBackend::initWorkspaceSettingConfig()
{ "trigger", QVariant(Application::kRestoreViewMode) } });
ins->addCheckBoxConfig(LV2_GROUP_VIEW ".03_open_folder_windows_in_aseparate_process",
tr("Open folder windows in a separate process"),
false);
true);
addSettingAccessor(
LV2_GROUP_VIEW ".03_open_folder_windows_in_aseparate_process",
[]() {
return DConfigManager::instance()->value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess,
false);
true);
},
[](const QVariant &val) {
DConfigManager::instance()->setValue(kViewDConfName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ bool FileOperatorMenuScene::triggered(QAction *action)
if (infoPtr && infoPtr->isAttributes(OptInfoType::kIsSymLink))
cdUrl = QUrl::fromLocalFile(infoPtr->pathOf(PathInfoType::kSymLinkTarget));

auto flag = DConfigManager::instance()->
auto flag = !DConfigManager::instance()->
value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess, false).toBool();
kOpenFolderWindowsInASeparateProcess, true).toBool();

if ((flag && FileManagerWindowsManager::instance().containsCurrentUrl(cdUrl)) ||
Application::instance()->appAttribute(Application::kAllwayOpenOnNewWindow).toBool()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ void ComputerEventCaller::cdTo(quint64 winId, const QUrl &url)
}

DFMBASE_USE_NAMESPACE
auto flag = DConfigManager::instance()->
auto flag = !DConfigManager::instance()->
value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess, false).toBool();
kOpenFolderWindowsInASeparateProcess, true).toBool();
if ((flag && FileManagerWindowsManager::instance().containsCurrentUrl(url))
|| Application::appAttribute(Application::ApplicationAttribute::kAllwayOpenOnNewWindow).toBool())
sendEnterInNewWindow(url, !flag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ void SideBarWidget::onItemActived(const QModelIndex &index)
}

QApplication::restoreOverrideCursor();
auto flag = DConfigManager::instance()->
auto flag = !DConfigManager::instance()->
value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess, false).toBool();
kOpenFolderWindowsInASeparateProcess, true).toBool();

auto target = item->targetUrl();
if (flag && FileManagerWindowsManager::instance().containsCurrentUrl(target, window())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ void FileOperatorHelper::openFilesByMode(const FileView *view, const QList<QUrl>
if (fileInfoPtr->isAttributes(OptInfoType::kIsSymLink))
dirUrl = QUrl::fromLocalFile(fileInfoPtr->pathOf(PathInfoType::kSymLinkTarget));

auto flag = DConfigManager::instance()->
auto flag = !DConfigManager::instance()->
value(kViewDConfName,
kOpenFolderWindowsInASeparateProcess, false).toBool();
kOpenFolderWindowsInASeparateProcess, true).toBool();
if (mode == DirOpenMode::kOpenNewWindow ||
(flag && FileManagerWindowsManager::instance().containsCurrentUrl(dirUrl, view->window()))) {
WorkspaceEventCaller::sendOpenWindow({ dirUrl }, !flag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,18 @@ void BaseItemDelegate::hideAllIIndexWidget()
void BaseItemDelegate::hideNotEditingIndexWidget()
{
}
// Cannot call this interface simultaneously as it will cause editwidget to destruct
// and crash on the second call to handle the signal
// Repeated reentry of this function will cause a crash
void BaseItemDelegate::commitDataAndCloseActiveEditor()
{
QWidget *editor = parent()->indexWidget(d->editingIndex);

if (!editor)
return;
{
QMutexLocker lk(&d->commitDataMutex);
if (d->commitDataCurentWidget == editor)
return;
d->commitDataCurentWidget = editor;
}

if (d->commitDataCurentWidget == editor)
return;
d->commitDataCurentWidget = editor;


QMetaObject::invokeMethod(this, "_q_commitDataAndCloseEditor",
Qt::DirectConnection, Q_ARG(QWidget *, editor));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class BaseItemDelegatePrivate
mutable QLineEdit *editor = nullptr;

AbstractItemPaintProxy *paintProxy { nullptr };
QMutex commitDataMutex;
QWidget *commitDataCurentWidget { nullptr };

BaseItemDelegate *q_ptr;
Expand Down
Loading