forked from qt-creator/qt-creator
Moved class FileUtils out of Internal namespace
...because it is being exported. Change-Id: If2892f8455b7c7fb9a78a8cde27642901ae4bf3a Reviewed-on: http://codereview.qt.nokia.com/3676 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
committed by
Robert Löhning
parent
9e0fc18fba
commit
662c66ef6b
@@ -812,13 +812,13 @@ void EditorManager::closeOtherEditorsFromContextMenu()
|
|||||||
void EditorManager::showInGraphicalShell()
|
void EditorManager::showInGraphicalShell()
|
||||||
{
|
{
|
||||||
const QString path = m_d->m_contextMenuEditorIndex.data(Qt::UserRole + 1).toString();
|
const QString path = m_d->m_contextMenuEditorIndex.data(Qt::UserRole + 1).toString();
|
||||||
Core::Internal::FileUtils::showInGraphicalShell(ICore::instance()->mainWindow(), path);
|
Core::FileUtils::showInGraphicalShell(ICore::instance()->mainWindow(), path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorManager::openTerminal()
|
void EditorManager::openTerminal()
|
||||||
{
|
{
|
||||||
const QString path = QFileInfo(m_d->m_contextMenuEditorIndex.data(Qt::UserRole + 1).toString()).path();
|
const QString path = QFileInfo(m_d->m_contextMenuEditorIndex.data(Qt::UserRole + 1).toString()).path();
|
||||||
Core::Internal::FileUtils::openTerminal(path);
|
Core::FileUtils::openTerminal(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorManager::closeEditor(Core::IEditor *editor)
|
void EditorManager::closeEditor(Core::IEditor *editor)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace Core::Internal;
|
using namespace Core;
|
||||||
|
|
||||||
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
|
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
|
||||||
// Show error with option to open settings.
|
// Show error with option to open settings.
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ class QWidget;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
struct CORE_EXPORT FileUtils
|
struct CORE_EXPORT FileUtils
|
||||||
{
|
{
|
||||||
@@ -52,7 +51,6 @@ struct CORE_EXPORT FileUtils
|
|||||||
static QString msgTerminalAction();
|
static QString msgTerminalAction();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
||||||
#endif // FILEUTILS_H
|
#endif // FILEUTILS_H
|
||||||
|
|||||||
@@ -307,9 +307,9 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
QAction *actionOpen = menu.addAction(actionOpenText(m_fileSystemModel, current));
|
QAction *actionOpen = menu.addAction(actionOpenText(m_fileSystemModel, current));
|
||||||
actionOpen->setEnabled(hasCurrentItem);
|
actionOpen->setEnabled(hasCurrentItem);
|
||||||
// Explorer & teminal
|
// Explorer & teminal
|
||||||
QAction *actionExplorer = menu.addAction(Core::Internal::FileUtils::msgGraphicalShellAction());
|
QAction *actionExplorer = menu.addAction(Core::FileUtils::msgGraphicalShellAction());
|
||||||
actionExplorer->setEnabled(hasCurrentItem);
|
actionExplorer->setEnabled(hasCurrentItem);
|
||||||
QAction *actionTerminal = menu.addAction(Core::Internal::FileUtils::msgTerminalAction());
|
QAction *actionTerminal = menu.addAction(Core::FileUtils::msgTerminalAction());
|
||||||
actionTerminal->setEnabled(hasCurrentItem);
|
actionTerminal->setEnabled(hasCurrentItem);
|
||||||
|
|
||||||
// open with...
|
// open with...
|
||||||
@@ -338,11 +338,11 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (action == actionTerminal) {
|
if (action == actionTerminal) {
|
||||||
Core::Internal::FileUtils::openTerminal(m_fileSystemModel->filePath(current));
|
Core::FileUtils::openTerminal(m_fileSystemModel->filePath(current));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (action == actionExplorer) {
|
if (action == actionExplorer) {
|
||||||
Core::Internal::FileUtils::showInGraphicalShell(this, m_fileSystemModel->filePath(current));
|
Core::FileUtils::showInGraphicalShell(this, m_fileSystemModel->filePath(current));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ProjectExplorerPlugin::openEditorFromAction(action,
|
ProjectExplorerPlugin::openEditorFromAction(action,
|
||||||
|
|||||||
@@ -584,13 +584,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
projecTreeContext);
|
projecTreeContext);
|
||||||
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
||||||
|
|
||||||
d->m_showInGraphicalShell = new QAction(Core::Internal::FileUtils::msgGraphicalShellAction(), this);
|
d->m_showInGraphicalShell = new QAction(Core::FileUtils::msgGraphicalShellAction(), this);
|
||||||
cmd = am->registerAction(d->m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL,
|
cmd = am->registerAction(d->m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL,
|
||||||
projecTreeContext);
|
projecTreeContext);
|
||||||
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
||||||
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
|
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
|
||||||
|
|
||||||
d->m_openTerminalHere = new QAction(Core::Internal::FileUtils::msgTerminalAction(), this);
|
d->m_openTerminalHere = new QAction(Core::FileUtils::msgTerminalAction(), this);
|
||||||
cmd = am->registerAction(d->m_openTerminalHere, ProjectExplorer::Constants::OPENTERMIANLHERE,
|
cmd = am->registerAction(d->m_openTerminalHere, ProjectExplorer::Constants::OPENTERMIANLHERE,
|
||||||
projecTreeContext);
|
projecTreeContext);
|
||||||
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
|
||||||
@@ -2525,14 +2525,14 @@ void ProjectExplorerPlugin::openFile()
|
|||||||
void ProjectExplorerPlugin::showInGraphicalShell()
|
void ProjectExplorerPlugin::showInGraphicalShell()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(d->m_currentNode, return)
|
QTC_ASSERT(d->m_currentNode, return)
|
||||||
Core::Internal::FileUtils::showInGraphicalShell(Core::ICore::instance()->mainWindow(),
|
Core::FileUtils::showInGraphicalShell(Core::ICore::instance()->mainWindow(),
|
||||||
pathFor(d->m_currentNode));
|
pathFor(d->m_currentNode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::openTerminalHere()
|
void ProjectExplorerPlugin::openTerminalHere()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(d->m_currentNode, return)
|
QTC_ASSERT(d->m_currentNode, return)
|
||||||
Core::Internal::FileUtils::openTerminal(directoryFor(d->m_currentNode));
|
Core::FileUtils::openTerminal(directoryFor(d->m_currentNode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::removeFile()
|
void ProjectExplorerPlugin::removeFile()
|
||||||
|
|||||||
Reference in New Issue
Block a user