diff options
Diffstat (limited to 'src/plugins')
72 files changed, 87 insertions, 144 deletions
diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index a5a1c22241a..3fa191ee0a2 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -531,8 +531,7 @@ QWidget *AndroidDeployQtStep::createConfigWidget() connect(installCustomApkButton, &QAbstractButton::clicked, this, [this, widget] { const FilePath packagePath - = FileUtils::getOpenFilePath(widget, - Tr::tr("Qt Android Installer"), + = FileUtils::getOpenFilePath(Tr::tr("Qt Android Installer"), FileUtils::homePath(), Tr::tr("Android package (*.apk)")); if (packagePath.isEmpty()) diff --git a/src/plugins/android/androidmanifesteditor.cpp b/src/plugins/android/androidmanifesteditor.cpp index b344b4a3a0a..cbb3047ad45 100644 --- a/src/plugins/android/androidmanifesteditor.cpp +++ b/src/plugins/android/androidmanifesteditor.cpp @@ -231,7 +231,6 @@ void IconWidget::setIconFromPath(const FilePath &iconPath) void IconWidget::selectIcon() { FilePath file = FileUtils::getOpenFilePath( - this, m_iconSelectionText, FileUtils::homePath(), //: %1 expands to wildcard list for file dialog, do not change order diff --git a/src/plugins/android/keystorecertificatedialog.cpp b/src/plugins/android/keystorecertificatedialog.cpp index df746b8e84a..710e32fa719 100644 --- a/src/plugins/android/keystorecertificatedialog.cpp +++ b/src/plugins/android/keystorecertificatedialog.cpp @@ -279,7 +279,7 @@ void AndroidCreateKeystoreCertificate::buttonBoxAccepted() if (!validateUserInput()) return; - m_keystoreFilePath = FileUtils::getSaveFilePath(this, Tr::tr("Keystore Filename"), + m_keystoreFilePath = FileUtils::getSaveFilePath(Tr::tr("Keystore Filename"), FileUtils::homePath() / "android_release.keystore", Tr::tr("Keystore files (*.keystore *.jks)")); if (m_keystoreFilePath.isEmpty()) diff --git a/src/plugins/android/manifestwizard.cpp b/src/plugins/android/manifestwizard.cpp index 3627c118173..d7bc20b87e1 100644 --- a/src/plugins/android/manifestwizard.cpp +++ b/src/plugins/android/manifestwizard.cpp @@ -255,7 +255,7 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles() if (m_directory.isEmpty()) return; - FileUtils::CopyAskingForOverwrite copy(this); + FileUtils::CopyAskingForOverwrite copy; Target *target = m_buildSystem->target(); QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit()); if (!version) diff --git a/src/plugins/android/splashscreencontainerwidget.cpp b/src/plugins/android/splashscreencontainerwidget.cpp index 22ea3a1738d..5bc42829b72 100644 --- a/src/plugins/android/splashscreencontainerwidget.cpp +++ b/src/plugins/android/splashscreencontainerwidget.cpp @@ -254,7 +254,7 @@ void SplashScreenWidget::setImageFromPath(const FilePath &imagePath, bool resize void SplashScreenWidget::selectImage() { - const FilePath file = FileUtils::getOpenFilePath(this, m_imageSelectionText, + const FilePath file = FileUtils::getOpenFilePath(m_imageSelectionText, FileUtils::homePath(), QStringLiteral("%1 (*.png *.jpg *.jpeg)") .arg(Tr::tr("Images"))); @@ -589,7 +589,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget( } }); connect(m_masterImage, &QToolButton::clicked, this, [this] { - const FilePath file = FileUtils::getOpenFilePath(this, Tr::tr("Select master image"), + const FilePath file = FileUtils::getOpenFilePath(Tr::tr("Select master image"), FileUtils::homePath(), fileDialogImageFiles); if (!file.isEmpty()) { for (auto &&imageWidget : m_imageWidgets) @@ -599,7 +599,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget( } }); connect(m_portraitMasterImage, &QToolButton::clicked, this, [this] { - const FilePath file = FileUtils::getOpenFilePath(this, Tr::tr("Select portrait master image"), + const FilePath file = FileUtils::getOpenFilePath(Tr::tr("Select portrait master image"), FileUtils::homePath(), fileDialogImageFiles); if (!file.isEmpty()) { for (auto &&imageWidget : m_portraitImageWidgets) @@ -609,7 +609,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget( } }); connect(m_landscapeMasterImage, &QToolButton::clicked, this, [this] { - const FilePath file = FileUtils::getOpenFilePath(this, Tr::tr("Select landscape master image"), + const FilePath file = FileUtils::getOpenFilePath(Tr::tr("Select landscape master image"), FileUtils::homePath(), fileDialogImageFiles); if (!file.isEmpty()) { for (auto &&imageWidget : m_landscapeImageWidgets) diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index d30c42e14b6..18b1edc3bca 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -656,7 +656,7 @@ void TestResultsPane::onCopyWholeTriggered() void TestResultsPane::onSaveWholeTriggered() { - const FilePath filePath = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Output To")); + const FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Save Output To")); if (filePath.isEmpty()) return; diff --git a/src/plugins/axivion/axivionperspective.cpp b/src/plugins/axivion/axivionperspective.cpp index 4d1fd6dd407..dfe44e5dc03 100644 --- a/src/plugins/axivion/axivionperspective.cpp +++ b/src/plugins/axivion/axivionperspective.cpp @@ -1119,8 +1119,7 @@ void AxivionPerspective::handleAnchorClicked(const QUrl &url) "Do you want to open \"%1\" with its default application?") .arg(url.toString()); const QMessageBox::StandardButton pressed - = CheckableMessageBox::question(Core::ICore::dialogParent(), - Tr::tr("Open External Links"), + = CheckableMessageBox::question(Tr::tr("Open External Links"), detail, Key("AxivionOpenExternalLinks")); if (pressed == QMessageBox::Yes) diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp index 86bca4e40d4..13a739f501b 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp @@ -376,7 +376,6 @@ private: void slotImportClicked() final { const FilePath filePath = FileUtils::getOpenFilePath( - this, Tr::tr("Import Code Format"), {}, Tr::tr("ClangFormat (*clang-format*);;All files (*)")); @@ -406,7 +405,6 @@ private: { ICodeStylePreferences *currentPreferences = m_codeStyle->currentPreferences(); const FilePath filePath = FileUtils::getSaveFilePath( - this, Tr::tr("Export Code Format"), FileUtils::homePath(), Tr::tr("ClangFormat (*clang-format*);;All files (*)")); diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index a5ecf187176..9c23b4cf63b 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -638,8 +638,7 @@ static bool continueDespiteReleaseBuild(const QString &toolName) "<p>%2</p>" "</body></html>") .arg(problem, question); - return CheckableMessageBox::question(ICore::dialogParent(), - title, + return CheckableMessageBox::question(title, message, Key("ClangToolsCorrectModeWarning")) == QMessageBox::Yes; @@ -968,8 +967,7 @@ void ClangTool::loadDiagnosticsFromFiles() { // Ask user for files const FilePaths filePaths - = FileUtils::getOpenFilePaths(nullptr, - Tr::tr("Select YAML Files with Diagnostics"), + = FileUtils::getOpenFilePaths(Tr::tr("Select YAML Files with Diagnostics"), FileUtils::homePath(), Tr::tr("YAML Files (*.yml *.yaml);;All Files (*)")); if (filePaths.isEmpty()) diff --git a/src/plugins/clangtools/clangtoolsutils.cpp b/src/plugins/clangtools/clangtoolsutils.cpp index e7b42a21b4a..5f144c97e92 100644 --- a/src/plugins/clangtools/clangtoolsutils.cpp +++ b/src/plugins/clangtools/clangtoolsutils.cpp @@ -138,8 +138,7 @@ QString hintAboutBuildBeforeAnalysis() void showHintAboutBuildBeforeAnalysis() { - Utils::CheckableMessageBox::information(Core::ICore::dialogParent(), - Tr::tr("Info About Build the Project Before Analysis"), + Utils::CheckableMessageBox::information(Tr::tr("Info About Build the Project Before Analysis"), hintAboutBuildBeforeAnalysis(), Key("ClangToolsDisablingBuildBeforeAnalysisHint")); } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 2fc3451e279..765ed17137e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -610,7 +610,6 @@ void CMakeBuildSettingsWidget::batchEditConfiguration() void CMakeBuildSettingsWidget::reconfigureWithInitialParameters() { QMessageBox::StandardButton reply = CheckableMessageBox::question( - Core::ICore::dialogParent(), Tr::tr("Re-configure with Initial Parameters"), Tr::tr("Clear CMake configuration and configure with initial parameters?"), settings(m_buildConfig->project()).askBeforeReConfigureInitialParams.askAgainCheckableDecider(), diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 0fd8c6edc24..0f137a4cdc7 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -18,7 +18,6 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> -#include <coreplugin/icore.h> #include <coreplugin/helpmanager.h> #include <coreplugin/messagemanager.h> #include <coreplugin/modemanager.h> @@ -450,7 +449,6 @@ void CMakeManager::reloadCMakePresets() return; QMessageBox::StandardButton clickedButton = CheckableMessageBox::question( - Core::ICore::dialogParent(), Tr::tr("Reload CMake Presets"), Tr::tr("Re-generates the kits that were created for CMake presets. All manual " "modifications to the CMake project settings will be lost."), diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index 5e12b1ba0e9..b17468894b6 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -743,8 +743,7 @@ void ShortcutSettingsWidget::resetToDefault() void ShortcutSettingsWidget::importAction() { - FilePath fileName = FileUtils::getOpenFilePath(nullptr, - Tr::tr("Import Keyboard Mapping Scheme"), + FilePath fileName = FileUtils::getOpenFilePath(Tr::tr("Import Keyboard Mapping Scheme"), schemesPath(), Tr::tr("Keyboard Mapping Scheme (*.kms)")); if (!fileName.isEmpty()) { diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index e2529372be6..697e68f186a 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -795,7 +795,7 @@ FilePath DocumentManager::getSaveFileName(const QString &title, const FilePath & bool repeat; do { repeat = false; - filePath = FileUtils::getSaveFilePath(nullptr, title, path, filter, selectedFilter); + filePath = FileUtils::getSaveFilePath(title, path, filter, selectedFilter); if (!filePath.isEmpty()) { // If the selected filter is All Files (*) we leave the name exactly as the user // specified. Otherwise the suffix must be one available in the selected filter. If @@ -1040,7 +1040,7 @@ FilePaths DocumentManager::getOpenFileNames(const QString &filters, QFileDialog::Options options) { const FilePath path = pathIn.isEmpty() ? fileDialogInitialDirectory() : pathIn; - const FilePaths files = FileUtils::getOpenFilePaths(nullptr, Tr::tr("Open File"), path, filters, + const FilePaths files = FileUtils::getOpenFilePaths(Tr::tr("Open File"), path, filters, selectedFilter, options); if (!files.isEmpty()) setFileDialogLastVisitedDirectory(files.front().absolutePath()); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index abab9654be8..c2fe46ff5f0 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -822,7 +822,7 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const FilePath &filePath) CheckableDecider decider(&askAgain); QMessageBox::StandardButton clickedButton - = CheckableMessageBox::question(ICore::dialogParent(), title, text, decider); + = CheckableMessageBox::question(title, text, decider); systemSettings().warnBeforeOpeningBigFiles.setValue(askAgain); return clickedButton != QMessageBox::Yes; } diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 266eae04cf2..2ebb4fbbefd 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -2040,7 +2040,6 @@ void ICorePrivate::registerDefaultActions() "Locator.Actions from the menu"); CheckableMessageBox::information( - Core::ICore::dialogParent(), Tr::tr("Hide Menu Bar"), Tr::tr("This will hide the menu bar completely. " "You can show it again by typing %1." diff --git a/src/plugins/coreplugin/locator/directoryfilter.cpp b/src/plugins/coreplugin/locator/directoryfilter.cpp index 23b853682d3..0b3407e33f3 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.cpp +++ b/src/plugins/coreplugin/locator/directoryfilter.cpp @@ -316,7 +316,7 @@ bool DirectoryFilter::openConfigDialog(QWidget *parent, bool &needsRefresh) void DirectoryFilter::handleAddDirectory() { - FilePath dir = FileUtils::getExistingDirectory(m_dialog, Tr::tr("Select Directory")); + FilePath dir = FileUtils::getExistingDirectory(Tr::tr("Select Directory")); if (!dir.isEmpty()) m_dialog->directoryList->addItem(dir.toUserOutput()); } @@ -326,7 +326,7 @@ void DirectoryFilter::handleEditDirectory() if (m_dialog->directoryList->selectedItems().count() < 1) return; QListWidgetItem *currentItem = m_dialog->directoryList->selectedItems().at(0); - FilePath dir = FileUtils::getExistingDirectory(m_dialog, Tr::tr("Select Directory"), + FilePath dir = FileUtils::getExistingDirectory(Tr::tr("Select Directory"), FilePath::fromUserInput(currentItem->text())); if (!dir.isEmpty()) currentItem->setText(dir.toUserOutput()); diff --git a/src/plugins/coreplugin/locator/filesystemfilter.cpp b/src/plugins/coreplugin/locator/filesystemfilter.cpp index 3213d32504b..cc7b423a78c 100644 --- a/src/plugins/coreplugin/locator/filesystemfilter.cpp +++ b/src/plugins/coreplugin/locator/filesystemfilter.cpp @@ -59,8 +59,7 @@ static ILocatorFilter::MatchLevel matchLevelFor(const QRegularExpressionMatch &m static bool askForCreating(const QString &title, const FilePath &filePath) { QMessageBox::StandardButton selected - = CheckableMessageBox::question(ICore::dialogParent(), - title, + = CheckableMessageBox::question(title, Tr::tr("Create \"%1\"?").arg(filePath.shortNativePath()), Key(kAlwaysCreate), QMessageBox::Yes | QMessageBox::Cancel, diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index 060e8b0ffff..8b3847b9ddf 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -33,6 +33,9 @@ #include <QSplitter> #include <QToolButton> #include <QVBoxLayout> + +using namespace Utils; + namespace Core::Internal { static QColor colorForCategory(const QString &category); @@ -947,10 +950,7 @@ void LoggingViewManagerWidget::showLogCategoryContextMenu(const QPoint &pos) con void LoggingViewManagerWidget::saveLoggingsToFile() const { - const Utils::FilePath fp = Utils::FileUtils::getSaveFilePath(ICore::dialogParent(), - Tr::tr("Save Logs As"), - {}, - "*.log"); + const FilePath fp = FileUtils::getSaveFilePath(Tr::tr("Save Logs As"), {}, "*.log"); if (fp.isEmpty()) return; @@ -980,10 +980,7 @@ void LoggingViewManagerWidget::saveLoggingsToFile() const void LoggingCategoryModel::saveEnabledCategoryPreset() const { - Utils::FilePath fp = Utils::FileUtils::getSaveFilePath(ICore::dialogParent(), - Tr::tr("Save Enabled Categories As..."), - {}, - "*.json"); + FilePath fp = FileUtils::getSaveFilePath(Tr::tr("Save Enabled Categories As..."), {}, "*.json"); if (fp.isEmpty()) return; @@ -1023,8 +1020,7 @@ void LoggingCategoryModel::saveEnabledCategoryPreset() const void LoggingCategoryModel::loadAndUpdateFromPreset() { - Utils::FilePath fp = Utils::FileUtils::getOpenFilePath(ICore::dialogParent(), - Tr::tr("Load Enabled Categories From")); + FilePath fp = FileUtils::getOpenFilePath(Tr::tr("Load Enabled Categories From")); if (fp.isEmpty()) return; // read file, update categories diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index 95e148225c4..d3c0a850ae7 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -305,7 +305,7 @@ void OutputWindow::contextMenuEvent(QContextMenuEvent *event) QAction *saveAction = menu->addAction(Tr::tr("Save Contents...")); connect(saveAction, &QAction::triggered, this, [this] { const FilePath file = FileUtils::getSaveFilePath( - ICore::dialogParent(), {}, FileUtils::homePath() / d->outputFileNameHint); + {}, FileUtils::homePath() / d->outputFileNameHint); if (!file.isEmpty()) { QString error; Utils::TextFileFormat format; diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index 8f06015aec7..a227a549ff3 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -528,7 +528,7 @@ bool executePluginInstallWizard(const FilePath &archive) return copyPluginFile(data.sourcePath, installPath); } else { QString error; - FileUtils::CopyAskingForOverwrite copy(ICore::dialogParent(), postCopyOperation()); + FileUtils::CopyAskingForOverwrite copy(postCopyOperation()); if (!FileUtils::copyRecursively(data.extractedPath, installPath, &error, copy())) { QMessageBox::warning( ICore::dialogParent(), Tr::tr("Failed to Copy Plugin Files"), error); diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index b9c64965a68..d34e62e4d28 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -487,7 +487,7 @@ void CppFileSettingsWidget::slotEdit() FilePath path = licenseTemplatePath(); if (path.isEmpty()) { // Pick a file name and write new template, edit with C++ - path = FileUtils::getSaveFilePath(this, Tr::tr("Choose Location for New License Template File")); + path = FileUtils::getSaveFilePath(Tr::tr("Choose Location for New License Template File")); if (path.isEmpty()) return; FileSaver saver(path, QIODevice::Text); diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 924026af056..e4472309f2c 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -2792,8 +2792,7 @@ void BreakpointManager::gotoLocation(const GlobalBreakpoint &gbp) const void BreakpointManager::executeDeleteAllBreakpointsDialog() { QMessageBox::StandardButton pressed - = CheckableMessageBox::question(ICore::dialogParent(), - Tr::tr("Remove All Breakpoints"), + = CheckableMessageBox::question(Tr::tr("Remove All Breakpoints"), Tr::tr("Are you sure you want to remove all breakpoints " "from all files in the current session?"), Key("RemoveAllBreakpoints")); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 0dc2d321613..009be94f88f 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -2239,8 +2239,7 @@ void CdbEngine::checkQtSdkPdbFiles(const QString &module) "symbols for the debugger.") .arg(qtName); - CheckableMessageBox::information_async(Core::ICore::dialogParent(), - Tr::tr("Missing Qt Debug Information"), + CheckableMessageBox::information_async(Tr::tr("Missing Qt Debug Information"), message, Key("CdbQtSdkPdbHint")); @@ -2264,7 +2263,6 @@ void CdbEngine::parseOutputLine(QString line) if (!m_initialSessionIdleHandled && line.startsWith("SECURE: File not allowed to be loaded") && line.endsWith("qtcreatorcdbext.dll")) { CheckableMessageBox::information( - Core::ICore::dialogParent(), Tr::tr("Debugger Start Failed"), Tr::tr("The system prevents loading of \"%1\", which is required for debugging. " "Make sure that your antivirus solution is up to date and if that does not work " diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index b096c82fd7d..a2a144db7d7 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2939,7 +2939,6 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp) } if (warnOnInappropriateDebugger) { CheckableMessageBox::information( - Core::ICore::dialogParent(), Tr::tr("Warning"), Tr::tr("The selected debugger may be inappropriate for the inferior.\n" "Examining symbols and setting breakpoints by file name and line number " diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index feaa221ab16..d05df3ad870 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1928,7 +1928,7 @@ void DebuggerPluginPrivate::dumpLog() LogWindow *logWindow = engine->logWindow(); QTC_ASSERT(logWindow, return); - const FilePath filePath = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Debugger Log"), + const FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Save Debugger Log"), TemporaryDirectory::masterDirectoryFilePath()); if (filePath.isEmpty()) return; @@ -2207,8 +2207,7 @@ bool wantRunTool(ToolMode toolMode, const QString &toolName) "or otherwise insufficient output.</p><p>" "Do you want to continue and run the tool in %2 mode?</p></body></html>") .arg(toolName).arg(currentMode).arg(toolModeString); - if (Utils::CheckableMessageBox::question(ICore::dialogParent(), - title, + if (Utils::CheckableMessageBox::question(title, message, Key("AnalyzerCorrectModeWarning")) != QMessageBox::Yes) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 3b7120c35b5..36341ce2882 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -652,7 +652,6 @@ void DebuggerRunTool::continueAfterDebugServerStart() bool doNotAskAgain = false; CheckableDecider decider(&doNotAskAgain); CheckableMessageBox::information( - Core::ICore::dialogParent(), Tr::tr("Debugger"), warningMessage, decider, diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 1b3916db281..8f5d6a92aea 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -381,7 +381,7 @@ void DebuggerSourcePathMappingWidget::slotAdd() void DebuggerSourcePathMappingWidget::slotAddQt() { // Add a mapping for various Qt build locations in case of unpatched builds. - const FilePath qtSourcesPath = FileUtils::getExistingDirectory(this, Tr::tr("Qt Sources")); + const FilePath qtSourcesPath = FileUtils::getExistingDirectory(Tr::tr("Qt Sources")); if (qtSourcesPath.isEmpty()) return; for (const QString &buildPath : qtBuildPaths()) diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp index 8e534ce9722..7816afab508 100644 --- a/src/plugins/debugger/logwindow.cpp +++ b/src/plugins/debugger/logwindow.cpp @@ -68,16 +68,16 @@ QChar static charForChannel(int channel) } } -static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent) +static bool writeLogContents(const QPlainTextEdit *editor) { bool success = false; while (!success) { - const FilePath filePath = FileUtils::getSaveFilePath(parent, Tr::tr("Log File")); + const FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Log File")); if (filePath.isEmpty()) break; FileSaver saver(filePath, QIODevice::Text); saver.write(editor->toPlainText().toUtf8()); - if (saver.finalize(parent)) + if (saver.finalize()) success = true; } return success; @@ -228,7 +228,7 @@ public: QAction *clearContentsAction() const { return m_clearContentsAction; } private: - void saveContents() { writeLogContents(this, this); } + void saveContents() { writeLogContents(this); } QAction *m_clearContentsAction; QAction *m_saveContentsAction; diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 69cd063f60d..90efd2b7c93 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -2570,7 +2570,6 @@ void WatchModel::clearWatches() return; const QMessageBox::StandardButton ret = CheckableMessageBox::question( - ICore::dialogParent(), Tr::tr("Remove All Expression Evaluators"), Tr::tr("Are you sure you want to remove all expression evaluators?"), Key("RemoveAllWatchers")); diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 26e614accd6..1a62c6d3d27 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -518,12 +518,12 @@ void DiffEditorPlugin::diffOpenFiles() void DiffEditorPlugin::diffExternalFiles() { - const FilePath filePath1 = FileUtils::getOpenFilePath(nullptr, Tr::tr("Select First File for Diff")); + const FilePath filePath1 = FileUtils::getOpenFilePath(Tr::tr("Select First File for Diff")); if (filePath1.isEmpty()) return; if (EditorManager::skipOpeningBigTextFile(filePath1)) return; - const FilePath filePath2 = FileUtils::getOpenFilePath(nullptr, Tr::tr("Select Second File for Diff")); + const FilePath filePath2 = FileUtils::getOpenFilePath(Tr::tr("Select Second File for Diff")); if (filePath2.isEmpty()) return; if (EditorManager::skipOpeningBigTextFile(filePath2)) diff --git a/src/plugins/fossil/fossilplugin.cpp b/src/plugins/fossil/fossilplugin.cpp index ea049c95d93..6ec17bbd086 100644 --- a/src/plugins/fossil/fossilplugin.cpp +++ b/src/plugins/fossil/fossilplugin.cpp @@ -687,7 +687,7 @@ void FossilPluginPrivate::createRepository() // Prompt for a directory that is not under version control yet QWidget *mw = ICore::dialogParent(); do { - directory = FileUtils::getExistingDirectory(nullptr, Tr::tr("Choose Checkout Directory"), directory); + directory = FileUtils::getExistingDirectory(Tr::tr("Choose Checkout Directory"), directory); if (directory.isEmpty()) return; const IVersionControl *managingControl = VcsManager::findVersionControlForDirectory(directory); diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 9db9c4d7a79..0222f2b91ce 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -335,7 +335,7 @@ void GerritPlugin::fetch(const std::shared_ptr<GerritChange> &change, int mode) const QString title = Git::Tr::tr("Enter Local Repository for \"%1\" (%2)").arg(change->project, change->branch); const FilePath suggestedRespository = findLocalRepository(change->project, change->branch); - repository = FileUtils::getExistingDirectory(m_dialog.data(), title, suggestedRespository); + repository = FileUtils::getExistingDirectory(title, suggestedRespository); } if (repository.isEmpty()) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 85f8dbfd7a4..811a754cc7d 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1267,7 +1267,6 @@ void GitClient::archive(const FilePath &workingDirectory, QString commit) commit = output.trimmed(); FilePath archiveName = FileUtils::getSaveFilePath( - nullptr, Tr::tr("Generate %1 archive").arg(repoName), repoDirectory.pathAppended(QString("../%1-%2").arg(repoName, commit.left(8))), filters.keys().join(";;"), @@ -1357,7 +1356,6 @@ QStringList GitClient::setupCheckoutArguments(const FilePath &workingDirectory, return arguments; if (Utils::CheckableMessageBox::question( - ICore::dialogParent() /*parent*/, Tr::tr("Create Local Branch") /*title*/, Tr::tr("Would you like to create a local branch?") /*message*/, Key("Git.CreateLocalBranchOnCheckout"), /* decider */ diff --git a/src/plugins/help/docsettingspage.cpp b/src/plugins/help/docsettingspage.cpp index 8663e6e93cd..e06815ed930 100644 --- a/src/plugins/help/docsettingspage.cpp +++ b/src/plugins/help/docsettingspage.cpp @@ -213,8 +213,7 @@ DocSettingsPageWidget::DocSettingsPageWidget() void DocSettingsPageWidget::addDocumentation() { - const FilePaths files = FileUtils::getOpenFilePaths(Core::ICore::dialogParent(), - Tr::tr("Add Documentation"), + const FilePaths files = FileUtils::getOpenFilePaths(Tr::tr("Add Documentation"), m_recentDialogPath, Tr::tr("Qt Help Files (*.qch)")); diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp index 384752d4c19..ae0a0eed3a8 100644 --- a/src/plugins/help/generalsettingspage.cpp +++ b/src/plugins/help/generalsettingspage.cpp @@ -351,8 +351,7 @@ void GeneralSettingsPageWidget::importBookmarks() { errorLabel->setVisible(false); - FilePath filePath = FileUtils::getOpenFilePath(nullptr, - Tr::tr("Import Bookmarks"), + FilePath filePath = FileUtils::getOpenFilePath(Tr::tr("Import Bookmarks"), FilePath::fromString(QDir::currentPath()), Tr::tr("Files (*.xbel)")); @@ -375,8 +374,7 @@ void GeneralSettingsPageWidget::exportBookmarks() { errorLabel->setVisible(false); - FilePath filePath = FileUtils::getSaveFilePath(nullptr, - Tr::tr("Save File"), + FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Save File"), "untitled.xbel", Tr::tr("Files (*.xbel)")); diff --git a/src/plugins/languageclient/lspinspector.cpp b/src/plugins/languageclient/lspinspector.cpp index 1f9dddfe7e3..685d5abce86 100644 --- a/src/plugins/languageclient/lspinspector.cpp +++ b/src/plugins/languageclient/lspinspector.cpp @@ -317,7 +317,7 @@ void LspLogWidget::saveLog() stream << "\n\n"; }); - const FilePath filePath = FileUtils::getSaveFilePath(this, Tr::tr("Log File")); + const FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Log File")); if (filePath.isEmpty()) return; FileSaver saver(filePath, QIODevice::Text); diff --git a/src/plugins/modeleditor/modeleditor.cpp b/src/plugins/modeleditor/modeleditor.cpp index dcf2c5b5185..4d5fdc180f6 100644 --- a/src/plugins/modeleditor/modeleditor.cpp +++ b/src/plugins/modeleditor/modeleditor.cpp @@ -613,7 +613,6 @@ void ModelEditor::exportToImage(bool selectedElements) filter += Tr::tr(";;SVG (*.svg)"); #endif // QT_NO_SVG QString fileName = FileUtils::getSaveFilePath( - nullptr, selectedElements ? Tr::tr("Export Selected Elements") : Tr::tr("Export Diagram"), FilePath::fromString(d->lastExportDirPath), filter).toFSPathString(); if (!fileName.isEmpty()) { diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 1cabd56984d..6ee2c1dc234 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -786,7 +786,7 @@ void PerforcePluginPrivate::annotateCurrentFile() void PerforcePluginPrivate::annotateFile() { - const FilePath filePath = FileUtils::getOpenFilePath(nullptr, Tr::tr("p4 annotate")); + const FilePath filePath = FileUtils::getOpenFilePath(Tr::tr("p4 annotate")); if (!filePath.isEmpty()) annotate(filePath.parentDir(), filePath.fileName()); } @@ -828,7 +828,7 @@ void PerforcePluginPrivate::filelogCurrentFile() void PerforcePluginPrivate::filelogFile() { - const FilePath file = FileUtils::getOpenFilePath(nullptr, Tr::tr("p4 filelog")); + const FilePath file = FileUtils::getOpenFilePath(Tr::tr("p4 filelog")); if (!file.isEmpty()) filelog(file.parentDir(), file.fileName()); } diff --git a/src/plugins/perfprofiler/perfloaddialog.cpp b/src/plugins/perfprofiler/perfloaddialog.cpp index eaec6c3c129..e1722b3a48e 100644 --- a/src/plugins/perfprofiler/perfloaddialog.cpp +++ b/src/plugins/perfprofiler/perfloaddialog.cpp @@ -89,7 +89,7 @@ ProjectExplorer::Kit *PerfLoadDialog::kit() const void PerfLoadDialog::on_browseTraceFileButton_pressed() { FilePath filePath = FileUtils::getOpenFilePath( - this, Tr::tr("Choose Perf Trace"), {}, + Tr::tr("Choose Perf Trace"), {}, Tr::tr("Perf traces (*%1)").arg(Constants::TraceFileExtension)); if (filePath.isEmpty()) return; @@ -99,8 +99,7 @@ void PerfLoadDialog::on_browseTraceFileButton_pressed() void PerfLoadDialog::on_browseExecutableDirButton_pressed() { - FilePath filePath = FileUtils::getExistingDirectory( - this, Tr::tr("Choose Directory of Executable")); + FilePath filePath = FileUtils::getExistingDirectory(Tr::tr("Choose Directory of Executable")); if (filePath.isEmpty()) return; diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index c5656855527..793a5a9ef77 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -589,7 +589,7 @@ void PerfProfilerTool::showLoadTraceDialog() { m_perspective.select(); - FilePath filePath = FileUtils::getOpenFilePath(nullptr, Tr::tr("Load Trace File"), + FilePath filePath = FileUtils::getOpenFilePath(Tr::tr("Load Trace File"), {}, Tr::tr("Trace File (*.ptq)")); if (filePath.isEmpty()) return; @@ -608,7 +608,7 @@ void PerfProfilerTool::showSaveTraceDialog() { m_perspective.select(); - FilePath filePath = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Trace File"), + FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Save Trace File"), {}, Tr::tr("Trace File (*.ptq)")); if (filePath.isEmpty()) return; diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 2b11622c346..e14bbabfe87 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -83,7 +83,7 @@ public: connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(addButton, &QPushButton::clicked, this, [this] { - const FilePath dir = FileUtils::getExistingDirectory(this, Tr::tr("Choose Directory")); + const FilePath dir = FileUtils::getExistingDirectory(Tr::tr("Choose Directory")); if (!dir.isEmpty()) addPath(dir.toUserOutput()); }); @@ -495,7 +495,7 @@ void EnvironmentWidget::unsetEnvironmentButtonClicked() void EnvironmentWidget::amendPathList(Utils::EnvironmentItem::Operation op) { const QString varName = d->m_model->indexToVariable(d->m_environmentView->currentIndex()); - const FilePath dir = FileUtils::getExistingDirectory(this, Tr::tr("Choose Directory")); + const FilePath dir = FileUtils::getExistingDirectory(Tr::tr("Choose Directory")); if (dir.isEmpty()) return; Utils::EnvironmentItems changes = d->m_model->userChanges(); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 5cdca7c87be..156345a1ec5 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -296,7 +296,7 @@ void KitManagerConfigWidget::setIcon() } iconMenu.addSeparator(); iconMenu.addAction(PathChooser::browseButtonLabel(), [this] { - const FilePath path = FileUtils::getOpenFilePath(this, Tr::tr("Select Icon"), + const FilePath path = FileUtils::getOpenFilePath(Tr::tr("Select Icon"), m_modifiedKit->iconPath(), Tr::tr("Images (*.png *.xpm *.jpg)")); if (path.isEmpty()) diff --git a/src/plugins/projectexplorer/parseissuesdialog.cpp b/src/plugins/projectexplorer/parseissuesdialog.cpp index 290833045a6..74c985245a0 100644 --- a/src/plugins/projectexplorer/parseissuesdialog.cpp +++ b/src/plugins/projectexplorer/parseissuesdialog.cpp @@ -50,7 +50,7 @@ ParseIssuesDialog::ParseIssuesDialog(QWidget *parent) : QDialog(parent), d(new P const auto loadFileButton = new QPushButton(Tr::tr("Load from File...")); connect(loadFileButton, &QPushButton::clicked, this, [this] { - const FilePath filePath = FileUtils::getOpenFilePath(this, Tr::tr("Choose File")); + const FilePath filePath = FileUtils::getOpenFilePath(Tr::tr("Choose File")); if (filePath.isEmpty()) return; QFile file(filePath.toString()); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 2385a7d4c13..32c0127f055 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -798,8 +798,7 @@ FilePath Project::projectDirectory() const void Project::changeRootProjectDirectory() { - FilePath rootPath = FileUtils::getExistingDirectory(nullptr, - ::PE::Tr::tr("Select the Root Directory"), + FilePath rootPath = FileUtils::getExistingDirectory(::PE::Tr::tr("Select the Root Directory"), rootProjectDirectory(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index e9bd1b51205..95076a45862 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1979,8 +1979,7 @@ void ProjectExplorerPluginPrivate::loadAction() dir = isProject ? fn : fn.absolutePath(); } - FilePath filePath = Utils::FileUtils::getOpenFilePath(ICore::dialogParent(), - Tr::tr("Load Project"), + FilePath filePath = Utils::FileUtils::getOpenFilePath(Tr::tr("Load Project"), dir, dd->projectFilterString()); if (filePath.isEmpty()) @@ -2005,8 +2004,7 @@ void ProjectExplorerPluginPrivate::openWorkspaceAction() dir = isProject ? fn : fn.absolutePath(); } - FilePath filePath = Utils::FileUtils::getExistingDirectory( - ICore::dialogParent(), Tr::tr("Open Workspace"), dir); + FilePath filePath = Utils::FileUtils::getExistingDirectory(Tr::tr("Open Workspace"), dir); if (filePath.isEmpty()) return; @@ -3664,7 +3662,7 @@ void ProjectExplorerPluginPrivate::addExistingProjects() QTC_ASSERT(projectNode, return); const FilePath dir = currentNode->directory(); FilePaths subProjectFilePaths = Utils::FileUtils::getOpenFilePaths( - nullptr, Tr::tr("Choose Project File"), dir, + Tr::tr("Choose Project File"), dir, projectNode->subProjectFileNamePatterns().join(";;")); if (!ProjectTree::hasNode(projectNode)) return; @@ -3702,7 +3700,7 @@ void ProjectExplorerPluginPrivate::handleAddExistingFiles() QTC_ASSERT(folderNode, return); const FilePaths filePaths = - Utils::FileUtils::getOpenFilePaths(nullptr, Tr::tr("Add Existing Files"), node->directory()); + Utils::FileUtils::getOpenFilePaths(Tr::tr("Add Existing Files"), node->directory()); if (filePaths.isEmpty()) return; diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 8dcf19bcf4b..248d797648c 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -927,7 +927,7 @@ public: QTC_ASSERT(projectImporter, return); FilePath importDir = - FileUtils::getExistingDirectory(nullptr, Tr::tr("Import Directory"), + FileUtils::getExistingDirectory(Tr::tr("Import Directory"), project->projectDirectory()); Target *lastTarget = nullptr; diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 0cfd0b23269..1860cdc0c0a 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1294,8 +1294,7 @@ bool RunControl::showPromptToStopDialog(const QString &title, if (prompt) decider = CheckableDecider(prompt); - auto selected = CheckableMessageBox::question(Core::ICore::dialogParent(), - title, + auto selected = CheckableMessageBox::question(title, text, decider, QMessageBox::Yes | QMessageBox::Cancel, diff --git a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp index b74190bb911..4f993d7380b 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp @@ -668,7 +668,6 @@ bool AlignDistribute::executePixelPerfectDialog() const Utils::CheckableDecider decider(Key("WarnAboutPixelPerfectDistribution")); QMessageBox::StandardButton pressed = Utils::CheckableMessageBox::question( - Core::ICore::dialogParent(), tr("Cannot Distribute Perfectly"), tr("These objects cannot be distributed to equal pixel values. " "Do you want to distribute to the nearest possible values?"), diff --git a/src/plugins/qmldesigner/libs/qmldesignerutils/fileextractor.cpp b/src/plugins/qmldesigner/libs/qmldesignerutils/fileextractor.cpp index efc72b79944..e11a46fe7cf 100644 --- a/src/plugins/qmldesigner/libs/qmldesignerutils/fileextractor.cpp +++ b/src/plugins/qmldesigner/libs/qmldesignerutils/fileextractor.cpp @@ -104,8 +104,7 @@ void FileExtractor::setTargetPath(const QString &path) void FileExtractor::browse() { - const FilePath path = FileUtils::getExistingDirectory(nullptr, tr("Choose Directory"), - m_targetPath); + const FilePath path = FileUtils::getExistingDirectory(tr("Choose Directory"), m_targetPath); if (!path.isEmpty()) { removeTempTargetPath(); m_targetPath = path; diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 9a0c38a1e7d..efc3fcd0641 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -644,7 +644,7 @@ void QmlProfilerTool::showSaveDialog() QLatin1String tFile(QtdFileExtension); QLatin1String zFile(QztFileExtension); FilePath filePath = FileUtils::getSaveFilePath( - nullptr, Tr::tr("Save QML Trace"), + Tr::tr("Save QML Trace"), globalSettings().lastTraceFile(), Tr::tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); if (!filePath.isEmpty()) { @@ -668,7 +668,7 @@ void QmlProfilerTool::showLoadDialog() QLatin1String tFile(QtdFileExtension); QLatin1String zFile(QztFileExtension); FilePath filePath = FileUtils::getOpenFilePath( - nullptr, Tr::tr("Load QML Trace"), + Tr::tr("Load QML Trace"), globalSettings().lastTraceFile(), Tr::tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 03b2166f902..3d228c0d2bb 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -597,7 +597,7 @@ void QnxSettingsWidget::addConfiguration() else filter = "*.sh file"; - const FilePath envFile = FileUtils::getOpenFilePath(this, Tr::tr("Select QNX Environment File"), + const FilePath envFile = FileUtils::getOpenFilePath(Tr::tr("Select QNX Environment File"), {}, filter); if (envFile.isEmpty()) return; diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index ec6b3b720ef..e382b2f984d 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -682,8 +682,7 @@ QtSettingsPageWidget::~QtSettingsPageWidget() void QtSettingsPageWidget::addQtDir() { FilePath qtVersion - = FileUtils::getOpenFilePath(this, - Tr::tr("Select a qmake Executable"), + = FileUtils::getOpenFilePath(Tr::tr("Select a qmake Executable"), {}, BuildableHelperLibrary::filterForQmakeFileDialog(), nullptr, @@ -754,8 +753,7 @@ void QtSettingsPageWidget::editPath() { QtVersion *current = currentVersion(); FilePath qtVersion = - FileUtils::getOpenFilePath(this, - Tr::tr("Select a qmake Executable"), + FileUtils::getOpenFilePath(Tr::tr("Select a qmake Executable"), current->qmakeFilePath().absolutePath(), BuildableHelperLibrary::filterForQmakeFileDialog(), nullptr, diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp index c7fdaaf50f9..f7801b3b964 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp +++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp @@ -31,7 +31,7 @@ PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog( const DeviceConstRef &device, QWidget *parent) { const FilePath dir = device.sshParameters().privateKeyFile.parentDir(); - const FilePath publicKeyFileName = FileUtils::getOpenFilePath(nullptr, + const FilePath publicKeyFileName = FileUtils::getOpenFilePath( Tr::tr("Choose Public Key File"), dir, Tr::tr("Public Key Files (*.pub);;All Files (*)")); if (publicKeyFileName.isEmpty()) diff --git a/src/plugins/remotelinux/sshkeycreationdialog.cpp b/src/plugins/remotelinux/sshkeycreationdialog.cpp index a94a56cf61e..aed27946b3a 100644 --- a/src/plugins/remotelinux/sshkeycreationdialog.cpp +++ b/src/plugins/remotelinux/sshkeycreationdialog.cpp @@ -129,7 +129,7 @@ void SshKeyCreationDialog::generateKeys() void SshKeyCreationDialog::handleBrowseButtonClicked() { - const FilePath filePath = FileUtils::getSaveFilePath(this, Tr::tr("Choose Private Key File Name")); + const FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Choose Private Key File Name")); if (!filePath.isEmpty()) setPrivateKeyFile(filePath); } diff --git a/src/plugins/screenrecorder/cropandtrim.cpp b/src/plugins/screenrecorder/cropandtrim.cpp index 14f4c7fb4ad..07e6da99e2d 100644 --- a/src/plugins/screenrecorder/cropandtrim.cpp +++ b/src/plugins/screenrecorder/cropandtrim.cpp @@ -338,7 +338,7 @@ CropWidget::CropWidget(QWidget *parent) connect(saveImageButton, &QToolButton::clicked, this, [this] { FilePathAspect &lastDir = Internal::settings().lastSaveImageDirectory; const QString ext(".png"); - FilePath file = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Current Frame As"), + FilePath file = FileUtils::getSaveFilePath(Tr::tr("Save Current Frame As"), lastDir(), "*" + ext); if (!file.isEmpty()) { if (!file.endsWith(ext)) diff --git a/src/plugins/screenrecorder/export.cpp b/src/plugins/screenrecorder/export.cpp index 00daed94a88..de845fd1cdc 100644 --- a/src/plugins/screenrecorder/export.cpp +++ b/src/plugins/screenrecorder/export.cpp @@ -155,7 +155,7 @@ ExportWidget::ExportWidget(QWidget *parent) [&lastFormat] (const Format &f) { return f.displayName == lastFormat(); }).fileDialogFilter(); - FilePath file = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save As"), lastDir(), + FilePath file = FileUtils::getSaveFilePath(Tr::tr("Save As"), lastDir(), fileDialogFilters(), &selectedFilter); if (!file.isEmpty()) { m_currentFormat = findOr(formats(), defaultFormat, diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 70e1d5e2758..cc0cbd00fd5 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -278,8 +278,7 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) }); connect(m_openClipAction, &QAction::triggered, this, [this, progressLabel] { const FilePath lastDir = Internal::settings().lastOpenDirectory(); - const FilePath file = FileUtils::getOpenFilePath(Core::ICore::dialogParent(), - m_openClipAction->text(), lastDir, + const FilePath file = FileUtils::getOpenFilePath(m_openClipAction->text(), lastDir, "Mov/qtrle rgb24 (*.mov)"); if (!file.isEmpty()) { Internal::settings().lastOpenDirectory.setValue(file.parentDir()); diff --git a/src/plugins/scxmleditor/common/mainwidget.cpp b/src/plugins/scxmleditor/common/mainwidget.cpp index b180caa5850..35909cc2bd6 100644 --- a/src/plugins/scxmleditor/common/mainwidget.cpp +++ b/src/plugins/scxmleditor/common/mainwidget.cpp @@ -421,8 +421,7 @@ void MainWidget::exportToImage() .arg(lastFolder) .arg(suggestedFileName) .arg(QDateTime::currentDateTime().toString("yyyyMMddhhmmss")); - const FilePath filePath = FileUtils::getSaveFilePath(this, - Tr::tr("Export Canvas to Image"), + const FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Export Canvas to Image"), FilePath::fromString(suggestedFileName), saveImageFileFilter()); if (!filePath.isEmpty()) { @@ -451,8 +450,7 @@ void MainWidget::saveScreenShot() const QString documentsLocation = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); const FilePath lastFolder = FilePath::fromSettings( s->value(Constants::C_SETTINGS_LASTSAVESCREENSHOTFOLDER, documentsLocation)); - const FilePath filePath = FileUtils::getSaveFilePath(this, - Tr::tr("Save Screenshot"), + const FilePath filePath = FileUtils::getSaveFilePath(Tr::tr("Save Screenshot"), lastFolder / "scxml_screenshot.png", saveImageFileFilter()); if (!filePath.isEmpty()) { diff --git a/src/plugins/scxmleditor/outputpane/errorwidget.cpp b/src/plugins/scxmleditor/outputpane/errorwidget.cpp index 6120ea573be..2bbd158a97a 100644 --- a/src/plugins/scxmleditor/outputpane/errorwidget.cpp +++ b/src/plugins/scxmleditor/outputpane/errorwidget.cpp @@ -186,7 +186,7 @@ QString ErrorWidget::modifyExportedValue(const QString &val) void ErrorWidget::exportWarnings() { - FilePath fileName = FileUtils::getSaveFilePath(this, Tr::tr("Export to File"), {}, Tr::tr("CSV files (*.csv)")); + FilePath fileName = FileUtils::getSaveFilePath(Tr::tr("Export to File"), {}, Tr::tr("CSV files (*.csv)")); if (fileName.isEmpty()) return; diff --git a/src/plugins/squish/squishfilehandler.cpp b/src/plugins/squish/squishfilehandler.cpp index d47a492708d..975f3646f6a 100644 --- a/src/plugins/squish/squishfilehandler.cpp +++ b/src/plugins/squish/squishfilehandler.cpp @@ -467,7 +467,7 @@ void addAllEntriesRecursively(SquishTestTreeItem *item) void SquishFileHandler::addSharedFolder() { const Utils::FilePath chosen = Utils::FileUtils::getExistingDirectory( - Core::ICore::dialogParent(), Tr::tr("Select Global Script Folder")); + Tr::tr("Select Global Script Folder")); if (chosen.isEmpty()) return; diff --git a/src/plugins/squish/squishnavigationwidget.cpp b/src/plugins/squish/squishnavigationwidget.cpp index d3fb523196e..46f81aae31c 100644 --- a/src/plugins/squish/squishnavigationwidget.cpp +++ b/src/plugins/squish/squishnavigationwidget.cpp @@ -15,7 +15,6 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/find/itemviewfind.h> -#include <coreplugin/icore.h> #include <coreplugin/inavigationwidgetfactory.h> #include <utils/algorithm.h> @@ -337,8 +336,7 @@ void SquishNavigationWidget::onRemoveSharedFileTriggered(const QModelIndex &idx) const QString detail = Tr::tr("Do you really want to delete \"%1\" permanently?") .arg(scriptFile.toUserOutput()); const QMessageBox::StandardButton pressed - = CheckableMessageBox::question(Core::ICore::dialogParent(), - Tr::tr("Remove Shared File"), + = CheckableMessageBox::question(Tr::tr("Remove Shared File"), detail, Key("RemoveSharedSquishScript"), QMessageBox::Yes | QMessageBox::No, @@ -388,7 +386,6 @@ void SquishNavigationWidget::onRemoveAllSharedFolderTriggered() void SquishNavigationWidget::onRecordTestCase(const QString &suiteName, const QString &testCase) { QMessageBox::StandardButton pressed = CheckableMessageBox::question( - Core::ICore::dialogParent(), Tr::tr("Record Test Case"), Tr::tr("Do you want to record over the test case \"%1\"? The existing content will " "be overwritten by the recorded script.") diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index de4bf4744b2..7aac82bde54 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -477,8 +477,7 @@ void SquishServerSettingsWidget::addMappedAut(TreeItem *categoryItem, SquishServ { FilePath entry = original ? FilePath::fromString(original->data(1, Qt::DisplayRole).toString()) : FilePath(); - const FilePath aut = FileUtils::getOpenFilePath(nullptr, Tr::tr("Select Application to test"), - entry); + const FilePath aut = FileUtils::getOpenFilePath(Tr::tr("Select Application to test"), entry); if (aut.isEmpty()) return; const QString fileName = aut.completeBaseName(); @@ -504,8 +503,7 @@ void SquishServerSettingsWidget::addAutPath(TreeItem *categoryItem, SquishServer const QString originalPathStr = original ? original->data(0, Qt::DisplayRole).toString() : QString(); FilePath entry = FilePath::fromString(originalPathStr); - const FilePath path = FileUtils::getExistingDirectory(nullptr, - Tr::tr("Select Application Path"), entry); + const FilePath path = FileUtils::getExistingDirectory(Tr::tr("Select Application Path"), entry); if (path.isEmpty() || path == entry) return; const QString pathStr = path.toString(); diff --git a/src/plugins/studiowelcome/qdsnewdialog.cpp b/src/plugins/studiowelcome/qdsnewdialog.cpp index e483effd8ae..107125ac802 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.cpp +++ b/src/plugins/studiowelcome/qdsnewdialog.cpp @@ -449,8 +449,7 @@ void QdsNewDialog::reject() QString QdsNewDialog::chooseProjectLocation() { - Utils::FilePath newPath = Utils::FileUtils::getExistingDirectory(m_dialog.get(), - tr("Choose Directory"), + Utils::FilePath newPath = Utils::FileUtils::getExistingDirectory(tr("Choose Directory"), m_qmlProjectLocation); return QDir::toNativeSeparators(newPath.toString()); diff --git a/src/plugins/terminal/terminalsettings.cpp b/src/plugins/terminal/terminalsettings.cpp index 4ac13061798..de8d7dac1b3 100644 --- a/src/plugins/terminal/terminalsettings.cpp +++ b/src/plugins/terminal/terminalsettings.cpp @@ -575,7 +575,6 @@ TerminalSettings::TerminalSettings() connect(loadThemeButton, &QPushButton::clicked, this, [] { const FilePath path = FileUtils::getOpenFilePath( - Core::ICore::dialogParent(), "Open Theme", {}, "All Scheme formats (*.itermcolors *.json *.colorscheme *.theme *.theme.txt);;" diff --git a/src/plugins/texteditor/bookmarkmanager.cpp b/src/plugins/texteditor/bookmarkmanager.cpp index eac800cfc33..930503a927f 100644 --- a/src/plugins/texteditor/bookmarkmanager.cpp +++ b/src/plugins/texteditor/bookmarkmanager.cpp @@ -298,8 +298,7 @@ void BookmarkView::keyPressEvent(QKeyEvent *event) void BookmarkView::removeAll() { - if (CheckableMessageBox::question(this, - Tr::tr("Remove All Bookmarks"), + if (CheckableMessageBox::question(Tr::tr("Remove All Bookmarks"), Tr::tr("Are you sure you want to remove all bookmarks from " "all files in the current session?"), Key("RemoveAllBookmarks")) diff --git a/src/plugins/texteditor/codestyleselectorwidget.cpp b/src/plugins/texteditor/codestyleselectorwidget.cpp index 5eb373f00f1..b1efbb6fc14 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.cpp +++ b/src/plugins/texteditor/codestyleselectorwidget.cpp @@ -198,7 +198,7 @@ void CodeStyleSelectorWidget::slotRemoveClicked() void CodeStyleSelectorWidget::slotImportClicked() { const FilePath fileName = - FileUtils::getOpenFilePath(this, Tr::tr("Import Code Style"), {}, + FileUtils::getOpenFilePath(Tr::tr("Import Code Style"), {}, Tr::tr("Code styles (*.xml);;All files (*)")); if (!fileName.isEmpty()) { CodeStylePool *codeStylePool = m_codeStyle->delegatingPool(); @@ -217,7 +217,6 @@ void CodeStyleSelectorWidget::slotExportClicked() { ICodeStylePreferences *currentPreferences = m_codeStyle->currentPreferences(); const FilePath filePath = FileUtils::getSaveFilePath( - this, Tr::tr("Export Code Style"), FileUtils::homePath().pathAppended(QString::fromUtf8(currentPreferences->id() + ".xml")), Tr::tr("Code styles (*.xml);;All files (*)")); diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 67fe67b6973..dac8152a1e4 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -601,8 +601,7 @@ void FontSettingsPageWidget::deleteColorScheme() void FontSettingsPageWidget::importScheme() { const FilePath importedFile - = Utils::FileUtils::getOpenFilePath(this, - Tr::tr("Import Color Scheme"), + = Utils::FileUtils::getOpenFilePath(Tr::tr("Import Color Scheme"), {}, Tr::tr("Color scheme (*.xml);;All files (*)")); @@ -650,8 +649,7 @@ void FontSettingsPageWidget::exportScheme() const ColorSchemeEntry &entry = m_schemeListModel.colorSchemeAt(index); const FilePath filePath - = Utils::FileUtils::getSaveFilePath(this, - Tr::tr("Export Color Scheme"), + = Utils::FileUtils::getSaveFilePath(Tr::tr("Export Color Scheme"), entry.filePath, Tr::tr("Color scheme (*.xml);;All files (*)")); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 11f6ee5a35f..39b73ab491b 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -853,7 +853,6 @@ void CallgrindTool::slotRequestDump() void CallgrindTool::loadExternalLogFile() { const FilePath filePath = FileUtils::getOpenFilePath( - nullptr, Tr::tr("Open Callgrind Log File"), {}, Tr::tr("Callgrind Output (callgrind.out*);;All Files (*)")); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 881cd29a6ee..24a277da57f 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -764,7 +764,6 @@ void MemcheckTool::heobAction() const QString dwarfstackPath = dialog.path() + '/' + dwarfstack; if (!QFileInfo::exists(dwarfstackPath) && CheckableMessageBox::information( - Core::ICore::dialogParent(), Tr::tr("Heob"), Tr::tr("Heob used with MinGW projects needs the %1 DLLs for proper " "stacktrace resolution.") @@ -987,7 +986,6 @@ void MemcheckTool::loadShowXmlLogFile(const QString &filePath, const QString &ex void MemcheckTool::loadExternalXmlLogFile() { const FilePath filePath = FileUtils::getOpenFilePath( - nullptr, Tr::tr("Open Memcheck XML Log File"), {}, Tr::tr("XML Files (*.xml);;All Files (*)")); diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index 386020c7a80..d1d521c158d 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -57,7 +57,7 @@ void SuppressionAspect::addSuppressionFile(const FilePath &suppression) void SuppressionAspectPrivate::slotAddSuppression() { const FilePaths files = - FileUtils::getOpenFilePaths(nullptr, + FileUtils::getOpenFilePaths( Tr::tr("Valgrind Suppression Files"), globalSettings().lastSuppressionDirectory(), Tr::tr("Valgrind Suppression File (*.supp);;All Files (*)")); diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 1a8f33258e0..8bd270daf3a 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -655,7 +655,7 @@ void VersionControlBase::createRepository() // Prompt for a directory that is not under version control yet QWidget *mw = ICore::dialogParent(); do { - directory = FileUtils::getExistingDirectory(nullptr, Tr::tr("Choose Repository Directory"), directory); + directory = FileUtils::getExistingDirectory(Tr::tr("Choose Repository Directory"), directory); if (directory.isEmpty()) return; const IVersionControl *managingControl = VcsManager::findVersionControlForDirectory(directory); |