forked from qt-creator/qt-creator
Utils: Replace FileChooser::path() by filePath().toString()
Keep the old method for now to ease downstream porting. The change is kept mechanical, there's a lot of cleanup possible now on the user code side. Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -274,23 +274,23 @@ void CorePlugin::addToPathChooserContextMenu(Utils::PathChooser *pathChooser, QM
|
||||
QList<QAction*> actions = menu->actions();
|
||||
QAction *firstAction = actions.isEmpty() ? nullptr : actions.first();
|
||||
|
||||
if (QDir().exists(pathChooser->path())) {
|
||||
if (QDir().exists(pathChooser->filePath().toString())) {
|
||||
auto *showInGraphicalShell = new QAction(Core::FileUtils::msgGraphicalShellAction(), menu);
|
||||
connect(showInGraphicalShell, &QAction::triggered, pathChooser, [pathChooser]() {
|
||||
Core::FileUtils::showInGraphicalShell(pathChooser, pathChooser->path());
|
||||
Core::FileUtils::showInGraphicalShell(pathChooser, pathChooser->filePath().toString());
|
||||
});
|
||||
menu->insertAction(firstAction, showInGraphicalShell);
|
||||
|
||||
auto *showInTerminal = new QAction(Core::FileUtils::msgTerminalHereAction(), menu);
|
||||
connect(showInTerminal, &QAction::triggered, pathChooser, [pathChooser]() {
|
||||
Core::FileUtils::openTerminal(pathChooser->path());
|
||||
Core::FileUtils::openTerminal(pathChooser->filePath().toString());
|
||||
});
|
||||
menu->insertAction(firstAction, showInTerminal);
|
||||
|
||||
} else {
|
||||
auto *mkPathAct = new QAction(tr("Create Folder"), menu);
|
||||
connect(mkPathAct, &QAction::triggered, pathChooser, [pathChooser]() {
|
||||
QDir().mkpath(pathChooser->path());
|
||||
QDir().mkpath(pathChooser->filePath().toString());
|
||||
pathChooser->triggerChanged();
|
||||
});
|
||||
menu->insertAction(firstAction, mkPathAct);
|
||||
|
||||
Reference in New Issue
Block a user