Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
667255c4
Commit
667255c4
authored
Jan 20, 2009
by
hjk
Browse files
some more ICore related cleanup
parent
897c05f5
Changes
35
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/filemanager.cpp
View file @
667255c4
...
...
@@ -85,18 +85,17 @@ using namespace Core::Internal;
static
const
char
*
settingsGroup
=
"RecentFiles"
;
static
const
char
*
filesKey
=
"Files"
;
FileManager
::
FileManager
(
Core
::
ICore
*
core
,
MainWindow
*
mw
)
:
QObject
(
mw
),
m_core
(
core
),
FileManager
::
FileManager
(
MainWindow
*
mw
)
:
QObject
(
mw
),
m_mainWindow
(
mw
),
m_fileWatcher
(
new
QFileSystemWatcher
(
this
)),
m_blockActivated
(
false
)
{
connect
(
m_fileWatcher
,
SIGNAL
(
fileChanged
(
const
QString
&
)),
this
,
SLOT
(
changedFile
(
const
QString
&
)));
connect
(
m_fileWatcher
,
SIGNAL
(
fileChanged
(
QString
)),
this
,
SLOT
(
changedFile
(
QString
)));
connect
(
m_mainWindow
,
SIGNAL
(
windowActivated
()),
this
,
SLOT
(
mainWindowActivated
()));
connect
(
m_core
,
SIGNAL
(
contextChanged
(
Core
::
IContext
*
)),
connect
(
Core
::
ICore
::
instance
()
,
SIGNAL
(
contextChanged
(
Core
::
IContext
*
)),
this
,
SLOT
(
syncWithEditor
(
Core
::
IContext
*
)));
QSettings
*
s
=
m_mainWindow
->
settings
();
...
...
@@ -440,7 +439,7 @@ QString FileManager::getSaveAsFileName(IFile *file)
}
QString
filterString
;
QString
preferredSuffix
;
if
(
const
MimeType
mt
=
m_core
->
mimeDatabase
()
->
findByFile
(
fi
))
{
if
(
const
MimeType
mt
=
Core
::
ICore
::
instance
()
->
mimeDatabase
()
->
findByFile
(
fi
))
{
filterString
=
mt
.
filterString
();
preferredSuffix
=
mt
.
preferredSuffix
();
}
...
...
@@ -510,7 +509,7 @@ void FileManager::syncWithEditor(Core::IContext *context)
if
(
!
context
)
return
;
Core
::
IEditor
*
editor
=
m_core
->
editorManager
()
->
currentEditor
();
Core
::
IEditor
*
editor
=
Core
::
ICore
::
instance
()
->
editorManager
()
->
currentEditor
();
if
(
editor
&&
(
editor
->
widget
()
==
context
->
widget
()))
setCurrentFile
(
editor
->
file
()
->
fileName
());
}
...
...
src/plugins/coreplugin/filemanager.h
View file @
667255c4
...
...
@@ -69,7 +69,7 @@ class CORE_EXPORT FileManager : public QObject
};
public:
FileManager
(
Core
::
ICore
*
core
,
Internal
::
MainWindow
*
ew
);
explicit
FileManager
(
Internal
::
MainWindow
*
ew
);
// file pool to monitor
bool
addFiles
(
const
QList
<
IFile
*>
&
files
);
...
...
@@ -99,10 +99,9 @@ public:
QString
getSaveAsFileName
(
IFile
*
file
);
QList
<
IFile
*>
saveModifiedFilesSilently
(
const
QList
<
IFile
*>
&
files
);
QList
<
IFile
*>
saveModifiedFiles
(
const
QList
<
IFile
*>
&
files
,
bool
*
cancelled
=
0
,
const
QString
&
message
=
QString
());
QList
<
IFile
*>
saveModifiedFiles
(
const
QList
<
IFile
*>
&
files
,
bool
*
cancelled
=
0
,
const
QString
&
message
=
QString
());
signals:
void
currentFileChanged
(
const
QString
&
filePath
);
...
...
@@ -130,7 +129,6 @@ private:
QString
m_currentFile
;
Core
::
ICore
*
m_core
;
Internal
::
MainWindow
*
m_mainWindow
;
QFileSystemWatcher
*
m_fileWatcher
;
QList
<
QPointer
<
IFile
>
>
m_changedFiles
;
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
667255c4
...
...
@@ -118,7 +118,7 @@ MainWindow::MainWindow() :
m_printer
(
0
),
m_actionManager
(
new
ActionManagerPrivate
(
this
,
m_uniqueIDManager
)),
m_editorManager
(
0
),
m_fileManager
(
new
FileManager
(
m_coreImpl
,
this
)),
m_fileManager
(
new
FileManager
(
this
)),
m_progressManager
(
new
ProgressManagerPrivate
()),
m_scriptManager
(
new
ScriptManagerPrivate
(
this
,
m_coreImpl
)),
m_variableManager
(
new
VariableManager
(
this
)),
...
...
@@ -217,9 +217,8 @@ void MainWindow::toggleNavigation()
void
MainWindow
::
setSuppressNavigationWidget
(
bool
suppress
)
{
if
(
NavigationWidgetPlaceHolder
::
current
())
{
if
(
NavigationWidgetPlaceHolder
::
current
())
m_navigationWidget
->
setSuppressed
(
suppress
);
}
}
MainWindow
::~
MainWindow
()
...
...
@@ -319,7 +318,7 @@ void MainWindow::extensionsInitialized()
m_viewManager
->
extensionsInitalized
();
m_messageManager
->
init
(
m_pluginManager
);
m_outputPane
->
init
(
m_coreImpl
,
m_pluginManager
);
m_outputPane
->
init
(
m_pluginManager
);
m_actionManager
->
initialize
();
readSettings
();
...
...
src/plugins/coreplugin/outputpane.cpp
View file @
667255c4
...
...
@@ -156,7 +156,6 @@ OutputPane::OutputPane(const QList<int> &context, QWidget *parent) :
m_closeButton
(
new
QToolButton
),
m_closeAction
(
0
),
m_pluginManager
(
0
),
m_core
(
0
),
m_lastIndex
(
-
1
),
m_outputWidgetPane
(
new
QStackedWidget
),
m_opToolBarWidgets
(
new
QStackedWidget
)
...
...
@@ -206,12 +205,11 @@ QWidget *OutputPane::buttonsWidget()
return
m_buttonsWidget
;
}
void
OutputPane
::
init
(
ICore
*
core
,
ExtensionSystem
::
PluginManager
*
pm
)
void
OutputPane
::
init
(
ExtensionSystem
::
PluginManager
*
pm
)
{
m_pluginManager
=
pm
;
m_core
=
core
;
ActionManager
*
am
=
m_core
->
actionManager
();
ActionManager
*
am
=
Core
::
ICore
::
instance
()
->
actionManager
();
ActionContainer
*
mwindow
=
am
->
actionContainer
(
Constants
::
M_WINDOW
);
// Window->Output Panes
...
...
src/plugins/coreplugin/outputpane.h
View file @
667255c4
...
...
@@ -51,7 +51,6 @@ namespace ExtensionSystem { class PluginManager; }
namespace
Core
{
class
ICore
;
class
IMode
;
class
IOutputPane
;
...
...
@@ -89,7 +88,7 @@ class OutputPane
public:
OutputPane
(
const
QList
<
int
>
&
context
,
QWidget
*
parent
=
0
);
~
OutputPane
();
void
init
(
Core
::
ICore
*
core
,
ExtensionSystem
::
PluginManager
*
pm
);
void
init
(
ExtensionSystem
::
PluginManager
*
pm
);
static
OutputPane
*
instance
();
const
QList
<
int
>
&
context
()
const
{
return
m_context
;
}
void
setCloseable
(
bool
b
);
...
...
@@ -123,7 +122,6 @@ private:
QAction
*
m_closeAction
;
ExtensionSystem
::
PluginManager
*
m_pluginManager
;
Core
::
ICore
*
m_core
;
QMap
<
int
,
Core
::
IOutputPane
*>
m_pageMap
;
int
m_lastIndex
;
...
...
src/plugins/designer/formeditorfactory.cpp
View file @
667255c4
...
...
@@ -46,11 +46,10 @@
using
namespace
Designer
::
Internal
;
using
namespace
Designer
::
Constants
;
FormEditorFactory
::
FormEditorFactory
(
Core
::
ICore
*
core
)
:
Core
::
IEditorFactory
(
c
ore
),
FormEditorFactory
::
FormEditorFactory
(
)
:
Core
::
IEditorFactory
(
C
ore
::
ICore
::
instance
()
),
m_kind
(
QLatin1String
(
C_FORMEDITOR
)),
m_mimeTypes
(
QLatin1String
(
FORM_MIMETYPE
)),
m_core
(
core
)
m_mimeTypes
(
QLatin1String
(
FORM_MIMETYPE
))
{
Core
::
FileIconProvider
*
iconProvider
=
Core
::
FileIconProvider
::
instance
();
iconProvider
->
registerIconForSuffix
(
QIcon
(
":/formeditor/images/qt_ui.png"
),
...
...
@@ -64,7 +63,7 @@ QString FormEditorFactory::kind() const
Core
::
IFile
*
FormEditorFactory
::
open
(
const
QString
&
fileName
)
{
Core
::
IEditor
*
iface
=
m_core
->
editorManager
()
->
openEditor
(
fileName
,
kind
());
Core
::
IEditor
*
iface
=
Core
::
ICore
::
instance
()
->
editorManager
()
->
openEditor
(
fileName
,
kind
());
return
iface
?
iface
->
file
()
:
0
;
}
...
...
src/plugins/designer/formeditorfactory.h
View file @
667255c4
...
...
@@ -39,7 +39,6 @@
#include <QtCore/QStringList>
namespace
Core
{
class
ICore
;
class
IEditor
;
class
IFile
;
}
...
...
@@ -52,10 +51,11 @@ class FormEditorFactory : public Core::IEditorFactory
Q_OBJECT
public:
FormEditorFactory
(
Core
::
ICore
*
core
);
FormEditorFactory
();
virtual
QStringList
mimeTypes
()
const
;
//EditorFactory
// IEditorFactory
virtual
QString
kind
()
const
;
Core
::
IFile
*
open
(
const
QString
&
fileName
);
Core
::
IEditor
*
createEditor
(
QWidget
*
parent
);
...
...
@@ -63,7 +63,6 @@ public:
private:
const
QString
m_kind
;
const
QStringList
m_mimeTypes
;
Core
::
ICore
*
m_core
;
};
}
// namespace Internal
...
...
src/plugins/designer/formeditorplugin.cpp
View file @
667255c4
...
...
@@ -104,7 +104,7 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
const
int
uid
=
core
->
uniqueIDManager
()
->
uniqueIdentifier
(
QLatin1String
(
C_FORMEDITOR
));
const
QList
<
int
>
context
=
QList
<
int
>
()
<<
uid
;
m_factory
=
new
FormEditorFactory
(
core
)
;
m_factory
=
new
FormEditorFactory
;
addObject
(
m_factory
);
// Make sure settings pages and action shortcuts are registered
...
...
src/plugins/designer/formeditorw.cpp
View file @
667255c4
...
...
@@ -561,8 +561,9 @@ FormWindowEditor *FormEditorW::createFormWindowEditor(QWidget* parentWidget)
QDesignerFormWindowInterface
*
form
=
m_fwm
->
createFormWindow
(
0
);
connect
(
form
,
SIGNAL
(
toolChanged
(
int
)),
this
,
SLOT
(
toolChanged
(
int
)));
qdesigner_internal
::
FormWindowBase
::
setupDefaultAction
(
form
);
FormWindowEditor
*
fww
=
new
FormWindowEditor
(
m_core
,
m_context
,
form
,
parentWidget
);
// Store a pointer to all form windows so we can unselect all other formwindows except the active one.
FormWindowEditor
*
fww
=
new
FormWindowEditor
(
m_context
,
form
,
parentWidget
);
// Store a pointer to all form windows so we can unselect
// all other formwindows except the active one.
m_formWindows
.
append
(
fww
);
connect
(
fww
,
SIGNAL
(
destroyed
()),
this
,
SLOT
(
editorDestroyed
()));
return
fww
;
...
...
@@ -604,7 +605,8 @@ void FormEditorW::currentEditorChanged(Core::IEditor *editor)
void
FormEditorW
::
activeFormWindowChanged
(
QDesignerFormWindowInterface
*
afw
)
{
if
(
debugFormEditor
)
qDebug
()
<<
"FormEditorW::activeFormWindowChanged"
<<
afw
<<
" of "
<<
m_fwm
->
formWindowCount
()
<<
m_formWindows
;
qDebug
()
<<
"FormEditorW::activeFormWindowChanged"
<<
afw
<<
" of "
<<
m_fwm
->
formWindowCount
()
<<
m_formWindows
;
m_fwm
->
closeAllPreviews
();
...
...
src/plugins/designer/formwindoweditor.cpp
View file @
667255c4
...
...
@@ -96,14 +96,13 @@ void QrcFilesVisitor::visitFolderNode(FolderNode *folderNode)
}
FormWindowEditor
::
FormWindowEditor
(
Core
::
ICore
*
core
,
const
QList
<
int
>
&
context
,
FormWindowEditor
::
FormWindowEditor
(
const
QList
<
int
>
&
context
,
QDesignerFormWindowInterface
*
form
,
QObject
*
parent
)
:
Core
::
IEditor
(
parent
),
QObject
*
parent
)
:
Core
::
IEditor
(
parent
),
m_context
(
context
),
m_formWindow
(
form
),
m_file
(
new
FormWindowFile
(
core
,
form
,
this
)),
m_file
(
new
FormWindowFile
(
form
,
this
)),
m_host
(
new
FormWindowHost
(
form
)),
m_editorWidget
(
new
EditorWidget
(
m_host
)),
m_toolBar
(
0
),
...
...
src/plugins/designer/formwindoweditor.h
View file @
667255c4
...
...
@@ -45,10 +45,6 @@ class QDesignerFormWindowManagerInterface;
class
QFile
;
QT_END_NAMESPACE
namespace
Core
{
class
ICore
;
}
namespace
ProjectExplorer
{
class
SessionNode
;
class
NodesWatcher
;
...
...
@@ -60,6 +56,7 @@ namespace Internal {
class
FormWindowFile
;
class
FormWindowHost
;
class
EditorWidget
;
// Master class maintaining a form window editor,
// containing file and widget host
...
...
@@ -68,8 +65,7 @@ class FormWindowEditor : public Core::IEditor
Q_OBJECT
public:
FormWindowEditor
(
Core
::
ICore
*
core
,
const
QList
<
int
>
&
context
,
FormWindowEditor
(
const
QList
<
int
>
&
context
,
QDesignerFormWindowInterface
*
form
,
QObject
*
parent
=
0
);
~
FormWindowEditor
();
...
...
@@ -85,7 +81,7 @@ public:
void
setDisplayName
(
const
QString
&
title
);
QToolBar
*
toolBar
();
QByteArray
saveState
()
const
;
bool
restoreState
(
const
QByteArray
&
/*
state
*/
);
bool
restoreState
(
const
QByteArray
&
state
);
// ContextInterface
QList
<
int
>
context
()
const
;
...
...
src/plugins/designer/formwindowfile.cpp
View file @
667255c4
...
...
@@ -56,17 +56,10 @@ using namespace SharedTools;
enum
{
debugFormWindowFile
=
0
};
FormWindowFile
::
FormWindowFile
(
Core
::
ICore
*
core
,
QDesignerFormWindowInterface
*
form
,
QObject
*
parent
)
:
Core
::
IFile
(
parent
),
FormWindowFile
::
FormWindowFile
(
QDesignerFormWindowInterface
*
form
,
QObject
*
parent
)
:
Core
::
IFile
(
parent
),
m_mimeType
(
QLatin1String
(
FORM_MIMETYPE
)),
m_formWindow
(
form
),
m_core
(
core
)
{
}
FormWindowFile
::~
FormWindowFile
()
m_formWindow
(
form
)
{
}
...
...
@@ -141,7 +134,7 @@ void FormWindowFile::modified(Core::IFile::ReloadBehavior *behavior)
break
;
}
switch
(
Core
::
Utils
::
reloadPrompt
(
m_fileName
,
m_core
->
mainWindow
()))
{
switch
(
Core
::
Utils
::
reloadPrompt
(
m_fileName
,
Core
::
ICore
::
instance
()
->
mainWindow
()))
{
case
Core
::
Utils
::
ReloadCurrent
:
emit
reload
(
m_fileName
);
break
;
...
...
src/plugins/designer/formwindowfile.h
View file @
667255c4
...
...
@@ -41,31 +41,22 @@
QT_BEGIN_NAMESPACE
class
QDesignerFormWindowInterface
;
class
QDesignerFormWindowManagerInterface
;
class
QFile
;
QT_END_NAMESPACE
namespace
Core
{
class
ICore
;
}
namespace
Designer
{
namespace
Internal
{
class
FormWindowSelection
;
class
FormWindowFile
:
public
Core
::
IFile
class
FormWindowFile
:
public
Core
::
IFile
{
Q_OBJECT
public:
FormWindowFile
(
Core
::
ICore
*
core
,
QDesignerFormWindowInterface
*
form
,
QObject
*
parent
=
0
);
~
FormWindowFile
();
FormWindowFile
(
QDesignerFormWindowInterface
*
form
,
QObject
*
parent
=
0
);
//IFile
//
IFile
bool
save
(
const
QString
&
fileName
=
QString
());
QString
fileName
()
const
;
bool
isModified
()
const
;
...
...
@@ -97,7 +88,6 @@ private:
QString
m_suggestedName
;
QDesignerFormWindowInterface
*
m_formWindow
;
Core
::
ICore
*
m_core
;
};
}
// namespace Internal
...
...
src/plugins/perforce/perforceplugin.cpp
View file @
667255c4
...
...
@@ -58,7 +58,7 @@
#include <vcsbase/basevcssubmiteditorfactory.h>
#include <vcsbase/vcsbaseeditor.h>
#include <QtCore/
qp
lugin
.h
>
#include <QtCore/
QtP
lugin>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
...
...
src/plugins/perforce/workbenchclientuser.cpp
View file @
667255c4
...
...
@@ -95,7 +95,7 @@ QString PromptDialog::input() const
WorkbenchClientUser
::
WorkbenchClientUser
(
PerforceOutputWindow
*
out
,
PerforcePlugin
*
plugin
)
:
QObject
(
out
),
m_plugin
(
plugin
),
m_core
IFace
(
PerforcePlugin
::
coreI
nstance
()),
m_core
(
Core
::
ICore
::
i
nstance
()),
m_currentEditorIface
(
0
),
m_userCancelled
(
false
),
m_mode
(
Submit
),
...
...
@@ -103,7 +103,7 @@ WorkbenchClientUser::WorkbenchClientUser(PerforceOutputWindow *out, PerforcePlug
m_skipNextMsg
(
false
),
m_eventLoop
(
new
QEventLoop
(
this
))
{
connect
(
m_core
IFace
,
SIGNAL
(
coreAboutToClose
()),
connect
(
m_core
,
SIGNAL
(
coreAboutToClose
()),
this
,
SLOT
(
cancelP4Command
()));
}
...
...
@@ -147,13 +147,13 @@ void WorkbenchClientUser::displayErrorMsg(const QString &msg)
const
QString
title
=
tr
(
"Perforce Error"
);
switch
(
m_mode
)
{
case
Submit
:
{
QMessageBox
msgBox
(
QMessageBox
::
Critical
,
title
,
msg
,
QMessageBox
::
Ok
,
m_core
IFace
->
mainWindow
());
QMessageBox
msgBox
(
QMessageBox
::
Critical
,
title
,
msg
,
QMessageBox
::
Ok
,
m_core
->
mainWindow
());
msgBox
.
setDetailedText
(
m_msg
);
msgBox
.
exec
();
}
break
;
default:
QMessageBox
::
critical
(
m_core
IFace
->
mainWindow
(),
title
,
msg
);
QMessageBox
::
critical
(
m_core
->
mainWindow
(),
title
,
msg
);
break
;
}
m_errMsg
.
clear
();
...
...
@@ -182,7 +182,7 @@ bool WorkbenchClientUser::editorAboutToClose(Core::IEditor *editor)
if
(
editor
&&
editor
==
m_currentEditorIface
)
{
if
(
m_mode
==
WorkbenchClientUser
::
Submit
)
{
const
QMessageBox
::
StandardButton
answer
=
QMessageBox
::
question
(
m_core
IFace
->
mainWindow
(),
QMessageBox
::
question
(
m_core
->
mainWindow
(),
tr
(
"Closing p4 Editor"
),
tr
(
"Do you want to submit this change list?"
),
QMessageBox
::
Yes
|
QMessageBox
::
No
|
QMessageBox
::
Cancel
,
QMessageBox
::
Yes
);
...
...
@@ -190,9 +190,9 @@ bool WorkbenchClientUser::editorAboutToClose(Core::IEditor *editor)
return
false
;
if
(
answer
==
QMessageBox
::
No
)
m_userCancelled
=
true
;
m_core
IFace
->
fileManager
()
->
blockFileChange
(
m_currentEditorIface
->
file
());
m_core
->
fileManager
()
->
blockFileChange
(
m_currentEditorIface
->
file
());
m_currentEditorIface
->
file
()
->
save
();
m_core
IFace
->
fileManager
()
->
unblockFileChange
(
m_currentEditorIface
->
file
());
m_core
->
fileManager
()
->
unblockFileChange
(
m_currentEditorIface
->
file
());
}
m_eventLoop
->
quit
();
m_currentEditorIface
=
0
;
...
...
@@ -228,7 +228,7 @@ void WorkbenchClientUser::Diff(FileSys *f1, FileSys *f2, int, char *, Error *err
delete
file2
;
QString
title
=
QString
(
"diff %1"
).
arg
(
f1
->
Name
());
m_currentEditorIface
=
m_core
IFace
->
editorManager
()
->
newFile
(
"Perforce Editor"
,
&
title
,
tmp
.
readAll
());
m_currentEditorIface
=
m_core
->
editorManager
()
->
newFile
(
"Perforce Editor"
,
&
title
,
tmp
.
readAll
());
if
(
!
m_currentEditorIface
)
{
err
->
Set
(
E_FAILED
,
"p4 data could not be opened!"
);
return
;
...
...
@@ -246,8 +246,8 @@ void WorkbenchClientUser::Edit(FileSys *f, Error *err)
m_currentEditorIface
=
m_plugin
->
openPerforceSubmitEditor
(
fileName
,
QStringList
());
}
else
{
m_currentEditorIface
=
m_core
IFace
->
editorManager
()
->
openEditor
(
fileName
);
m_core
IFace
->
editorManager
()
->
ensureEditorManagerVisible
();
m_currentEditorIface
=
m_core
->
editorManager
()
->
openEditor
(
fileName
);
m_core
->
editorManager
()
->
ensureEditorManagerVisible
();
}
if
(
!
m_currentEditorIface
)
{
err
->
Set
(
E_FAILED
,
"p4 data could not be opened!"
);
...
...
@@ -265,7 +265,7 @@ void WorkbenchClientUser::Prompt(const StrPtr &msg, StrBuf &answer, int , Error
err
->
Set
(
E_FATAL
,
""
);
return
;
}
PromptDialog
dia
(
msg
.
Text
(),
m_msg
,
qobject_cast
<
QWidget
*>
(
m_core
IFace
));
PromptDialog
dia
(
msg
.
Text
(),
m_msg
,
qobject_cast
<
QWidget
*>
(
m_core
));
dia
.
exec
();
answer
=
qstrdup
(
dia
.
input
().
toLatin1
().
constData
());
if
(
m_mode
==
WorkbenchClientUser
::
Resolve
)
{
...
...
@@ -282,5 +282,5 @@ void WorkbenchClientUser::Prompt(const StrPtr &msg, StrBuf &answer, int , Error
void
WorkbenchClientUser
::
ErrorPause
(
char
*
msg
,
Error
*
)
{
QMessageBox
::
warning
(
m_core
IFace
->
mainWindow
(),
tr
(
"Perforce Error"
),
QString
::
fromUtf8
(
msg
));
QMessageBox
::
warning
(
m_core
->
mainWindow
(),
tr
(
"Perforce Error"
),
QString
::
fromUtf8
(
msg
));
}
src/plugins/perforce/workbenchclientuser.h
View file @
667255c4
...
...
@@ -61,8 +61,7 @@ class PerforcePlugin;
class
PromptDialog
:
public
QDialog
{
public:
PromptDialog
(
const
QString
&
choice
,
const
QString
&
text
,
QWidget
*
parent
=
0
);
PromptDialog
(
const
QString
&
choice
,
const
QString
&
text
,
QWidget
*
parent
=
0
);
QString
input
()
const
;
private:
...
...
@@ -96,7 +95,7 @@ private:
void
displayErrorMsg
(
const
QString
&
msg
);
PerforcePlugin
*
m_plugin
;
Core
::
ICore
*
m_core
IFace
;
Core
::
ICore
*
m_core
;
Core
::
IEditor
*
m_currentEditorIface
;
bool
m_userCancelled
;
Mode
m_mode
;
...
...
src/plugins/projectexplorer/foldernavigationwidget.cpp
View file @
667255c4
...
...
@@ -61,7 +61,7 @@ class FirstRowFilter : public QSortFilterProxyModel
public:
FirstRowFilter
(
QObject
*
parent
=
0
)
:
QSortFilterProxyModel
(
parent
)
{}
protected:
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
)
const
{
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
)
const
{
return
source_row
!=
0
;
}
};
...
...
@@ -74,15 +74,14 @@ protected:
Shows a file system folder
*/
FolderNavigationWidget
::
FolderNavigationWidget
(
Core
::
ICore
*
core
,
QWidget
*
parent
)
:
QWidget
(
parent
),
m_core
(
core
),
m_explorer
(
ProjectExplorerPlugin
::
instance
()),
m_view
(
new
QListView
(
this
)),
m_dirModel
(
new
QDirModel
(
this
)),
m_filter
(
new
FirstRowFilter
(
this
)),
m_title
(
new
QLabel
(
this
)),
m_autoSync
(
false
)
FolderNavigationWidget
::
FolderNavigationWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
),
m_explorer
(
ProjectExplorerPlugin
::
instance
()),
m_view
(
new
QListView
(
this
)),
m_dirModel
(
new
QDirModel
(
this
)),
m_filter
(
new
FirstRowFilter
(
this
)),
m_title
(
new
QLabel
(
this
)),
m_autoSync
(
false
)
{
m_dirModel
->
setFilter
(
QDir
::
Dirs
|
QDir
::
Files
|
QDir
::
Drives
|
QDir
::
Readable
|
QDir
::
Writable
|
QDir
::
Executable
|
QDir
::
Hidden
);
...
...
@@ -124,14 +123,14 @@ void FolderNavigationWidget::setAutoSynchronization(bool sync)
m_autoSync
=
sync
;
Core
::
FileManager
*
fileManager
=
m_core
->
fileManager
();
Core
::
FileManager
*
fileManager
=
Core
::
ICore
::
instance
()
->
fileManager
();
if
(
m_autoSync
)
{
connect
(
fileManager
,
SIGNAL
(
currentFileChanged
(
const
QString
&
)),
this
,
SLOT
(
setCurrentFile
(
const
QString
&
)));
connect
(
fileManager
,
SIGNAL
(
currentFileChanged
(
QString
)),
this
,
SLOT
(
setCurrentFile
(
QString
)));
setCurrentFile
(
fileManager
->
currentFile
());
}
else
{
disconnect
(
fileManager
,
SIGNAL
(
currentFileChanged
(
const
QString
&
)),
this
,
SLOT
(
setCurrentFile
(
const
QString
&
)));
disconnect
(
fileManager
,
SIGNAL
(
currentFileChanged
(
QString
)),
this
,
SLOT
(
setCurrentFile
(
QString
)));
}
}
...
...
@@ -171,8 +170,9 @@ void FolderNavigationWidget::openItem(const QModelIndex &index)
setCurrentTitle
(
QDir
(
m_dirModel
->
filePath
(
srcIndex
)));
}
else
{
const
QString
filePath
=
m_dirModel
->
filePath
(
srcIndex
);
m_core
->
editorManager
()
->
openEditor
(
filePath
);
m_core
->
editorManager
()
->
ensureEditorManagerVisible
();
Core
::
EditorManager
*
editorManager
=
Core
::
ICore
::
instance
()
->
editorManager
();
editorManager
->
openEditor
(
filePath
);
editorManager
->
ensureEditorManagerVisible
();
}
}
}
...
...
@@ -183,8 +183,7 @@ void FolderNavigationWidget::setCurrentTitle(const QDir &dir)
m_title
->
setToolTip
(
dir
.
absolutePath
());
}
FolderNavigationWidgetFactory
::
FolderNavigationWidgetFactory
(
Core
::
ICore
*
core
)
:
m_core
(
core
)
FolderNavigationWidgetFactory
::
FolderNavigationWidgetFactory
()
{
}
...
...
@@ -205,7 +204,7 @@ QKeySequence FolderNavigationWidgetFactory::activationSequence()
Core
::
NavigationView
FolderNavigationWidgetFactory
::
createWidget
()
{
Core
::
NavigationView
n
;
FolderNavigationWidget
*
ptw
=
new
FolderNavigationWidget
(
m_core
)
;
FolderNavigationWidget
*
ptw
=
new
FolderNavigationWidget
;
n
.
widget
=
ptw
;
QToolButton
*
toggleSync
=
new
QToolButton
;
toggleSync
->
setProperty
(
"type"
,
"dockbutton"
);
...
...
src/plugins/projectexplorer/foldernavigationwidget.h
View file @
667255c4
...
...
@@ -36,15 +36,11 @@
#include <coreplugin/inavigationwidgetfactory.h>
#include <QtGui/QWidget>
#include <QtGui/QListView>
#include <QtGui/QDirModel>
#include <QtGui/QLabel>
#include <QtGui/QListView>
#include <QtGui/QSortFilterProxyModel>
namespace
Core
{
class
ICore
;
}
#include <QtGui/QWidget>
namespace
ProjectExplorer
{
...
...
@@ -54,10 +50,11 @@ class Node;
namespace
Internal
{
class
FolderNavigationWidget
:
public
QWidget
{
class
FolderNavigationWidget
:
public
QWidget
{
Q_OBJECT
public:
FolderNavigationWidget
(
Core
::
ICore
*
core
,
QWidget
*
parent
=
0
);
FolderNavigationWidget
(
QWidget
*
parent
=
0
);
bool
autoSynchronization
()
const
;