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
3319797d
Commit
3319797d
authored
Mar 30, 2010
by
con
Browse files
Some plugin spec property renaming.
parent
74005136
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/libs/extensionsystem/pluginmanager.cpp
View file @
3319797d
...
...
@@ -623,13 +623,13 @@ void PluginManagerPrivate::writeSettings()
QSettings
settings
(
QSettings
::
IniFormat
,
QSettings
::
UserScope
,
QLatin1String
(
"Nokia"
),
QLatin1String
(
"QtCreator"
));
QStringList
notLoad
edPlugins
;
QStringList
tempDisabl
edPlugins
;
foreach
(
PluginSpec
*
spec
,
pluginSpecs
)
{
if
(
!
spec
->
loadOnStartup
())
notLoad
edPlugins
.
append
(
spec
->
name
());
if
(
!
spec
->
isEnabled
())
tempDisabl
edPlugins
.
append
(
spec
->
name
());
}
settings
.
setValue
(
QLatin1String
(
C_IGNORED_PLUGINS
),
notLoad
edPlugins
);
settings
.
setValue
(
QLatin1String
(
C_IGNORED_PLUGINS
),
tempDisabl
edPlugins
);
}
void
PluginManagerPrivate
::
loadSettings
()
...
...
@@ -637,8 +637,7 @@ void PluginManagerPrivate::loadSettings()
const
QSettings
settings
(
QSettings
::
IniFormat
,
QSettings
::
UserScope
,
QLatin1String
(
"Nokia"
),
QLatin1String
(
"QtCreator"
));
notLoadedPlugins
=
settings
.
value
(
QLatin1String
(
C_IGNORED_PLUGINS
)).
toStringList
();
disabledPlugins
=
settings
.
value
(
QLatin1String
(
C_IGNORED_PLUGINS
)).
toStringList
();
}
void
PluginManagerPrivate
::
stopAll
()
...
...
@@ -762,7 +761,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
circularityCheckQueue
.
append
(
spec
);
// check if we have the dependencies
if
(
spec
->
state
()
==
PluginSpec
::
Invalid
||
spec
->
state
()
==
PluginSpec
::
Read
)
{
if
(
!
spec
->
d
->
ignoreOnStartup
&&
spec
->
d
->
loadOnStartup
)
{
if
(
!
spec
->
isDisabledByDependency
()
&&
spec
->
isEnabled
()
)
{
spec
->
d
->
hasError
=
true
;
spec
->
d
->
errorString
+=
"
\n
"
;
spec
->
d
->
errorString
+=
PluginManager
::
tr
(
"Cannot load plugin because dependencies are not resolved"
);
...
...
@@ -790,7 +789,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
*/
void
PluginManagerPrivate
::
loadPlugin
(
PluginSpec
*
spec
,
PluginSpec
::
State
destState
)
{
if
(
spec
->
hasError
()
||
spec
->
i
gnoreOnStartup
())
if
(
spec
->
hasError
()
||
spec
->
i
sDisabledByDependency
())
return
;
switch
(
destState
)
{
...
...
@@ -884,8 +883,8 @@ void PluginManagerPrivate::readPluginPaths()
collection
=
new
PluginCollection
(
spec
->
category
());
pluginCategories
.
insert
(
spec
->
category
(),
collection
);
}
if
(
notLoad
edPlugins
.
contains
(
spec
->
name
()))
spec
->
set
LoadOnStartup
(
false
);
if
(
disabl
edPlugins
.
contains
(
spec
->
name
()))
spec
->
set
Enabled
(
false
);
collection
->
addPlugin
(
spec
);
pluginSpecs
.
append
(
spec
);
...
...
src/libs/extensionsystem/pluginmanager_p.h
View file @
3319797d
...
...
@@ -79,7 +79,7 @@ public:
QStringList
pluginPaths
;
QString
extension
;
QList
<
QObject
*>
allObjects
;
// ### make this a QList<QPointer<QObject> > > ?
QStringList
notLoad
edPlugins
;
QStringList
disabl
edPlugins
;
QStringList
arguments
;
QScopedPointer
<
QTime
>
m_profileTimer
;
...
...
src/libs/extensionsystem/pluginspec.cpp
View file @
3319797d
...
...
@@ -240,14 +240,14 @@ QString PluginSpec::category() const
\fn bool PluginSpec::loadOnStartup() const
True if the plugin is loaded at startup. True by default - the user can change it from the Plugin settings.
*/
bool
PluginSpec
::
loadOnStartup
()
const
bool
PluginSpec
::
isEnabled
()
const
{
return
d
->
loadOnStartup
;
return
d
->
enabled
;
}
bool
PluginSpec
::
i
gnoreOnStartup
()
const
bool
PluginSpec
::
i
sDisabledByDependency
()
const
{
return
d
->
ignoreOnStartup
;
return
d
->
disabledByDependency
;
}
/*!
...
...
@@ -437,8 +437,8 @@ namespace {
*/
PluginSpecPrivate
::
PluginSpecPrivate
(
PluginSpec
*
spec
)
:
loadOnStartup
(
true
),
ignoreOnStartup
(
false
),
enabled
(
true
),
disabledByDependency
(
false
),
plugin
(
0
),
state
(
PluginSpec
::
Invalid
),
hasError
(
false
),
...
...
@@ -496,14 +496,9 @@ bool PluginSpecPrivate::read(const QString &fileName)
return
true
;
}
void
PluginSpec
::
set
LoadOnStartup
(
bool
value
)
void
PluginSpec
::
set
Enabled
(
bool
value
)
{
d
->
loadOnStartup
=
value
;
}
void
PluginSpec
::
setIgnoreOnStartup
(
bool
value
)
{
d
->
ignoreOnStartup
=
value
;
d
->
enabled
=
value
;
}
/*!
...
...
@@ -797,8 +792,8 @@ bool PluginSpecPrivate::resolveDependencies(const QList<PluginSpec *> &specs)
foreach
(
PluginSpec
*
spec
,
specs
)
{
if
(
spec
->
provides
(
dependency
.
name
,
dependency
.
version
))
{
found
=
spec
;
if
(
!
spec
->
loadOnStartup
()
||
spec
->
ignoreOnStartup
())
ignoreOnStartup
=
true
;
if
(
!
spec
->
isEnabled
()
||
spec
->
isDisabledByDependency
())
disabledByDependency
=
true
;
spec
->
addDependentPlugin
(
q
);
...
...
@@ -820,7 +815,7 @@ bool PluginSpecPrivate::resolveDependencies(const QList<PluginSpec *> &specs)
dependencySpecs
=
resolvedDependencies
;
if
(
loadOnStartup
&&
!
ignoreOnStartup
)
if
(
enabled
&&
!
disabledByDependency
)
state
=
PluginSpec
::
Resolved
;
return
true
;
...
...
src/libs/extensionsystem/pluginspec.h
View file @
3319797d
...
...
@@ -79,9 +79,9 @@ public:
QString
description
()
const
;
QString
url
()
const
;
QString
category
()
const
;
bool
loadOnStartup
()
const
;
bool
isEnabled
()
const
;
// true if loading was not done due to user unselecting this plugin or its dependencies
bool
i
gnoreOnStartup
()
const
;
bool
i
sDisabledByDependency
()
const
;
QList
<
PluginDependency
>
dependencies
()
const
;
typedef
QList
<
PluginArgumentDescription
>
PluginArgumentDescriptions
;
...
...
@@ -91,8 +91,7 @@ public:
QString
location
()
const
;
QString
filePath
()
const
;
void
setLoadOnStartup
(
bool
value
);
void
setIgnoreOnStartup
(
bool
value
);
void
setEnabled
(
bool
value
);
QStringList
arguments
()
const
;
void
setArguments
(
const
QStringList
&
arguments
);
...
...
src/libs/extensionsystem/pluginspec_p.h
View file @
3319797d
...
...
@@ -69,8 +69,8 @@ public:
QString
url
;
QString
category
;
QList
<
PluginDependency
>
dependencies
;
bool
loadOnStartup
;
bool
ignoreOnStartup
;
bool
enabled
;
bool
disabledByDependency
;
QString
location
;
QString
filePath
;
...
...
src/libs/extensionsystem/pluginview.cpp
View file @
3319797d
...
...
@@ -178,7 +178,7 @@ void PluginView::updateList()
defaultCollectionItem
->
setData
(
0
,
Qt
::
UserRole
,
qVariantFromValue
(
defaultCollection
));
foreach
(
PluginSpec
*
spec
,
m_specToItem
.
keys
())
toggleRelatedPlugins
(
spec
,
spec
->
loadOnStartup
()
&&
!
spec
->
i
gnoreOnStartup
());
toggleRelatedPlugins
(
spec
,
spec
->
isEnabled
()
&&
!
spec
->
i
sDisabledByDependency
());
m_ui
->
categoryWidget
->
clear
();
if
(
!
m_items
.
isEmpty
())
{
...
...
@@ -217,7 +217,7 @@ int PluginView::parsePluginSpecs(QTreeWidgetItem *parentItem, Qt::CheckState &gr
pluginItem
->
setData
(
0
,
Qt
::
UserRole
,
qVariantFromValue
(
spec
));
Qt
::
CheckState
state
=
Qt
::
Unchecked
;
if
(
spec
->
loadOnStartup
())
{
if
(
spec
->
isEnabled
())
{
state
=
Qt
::
Checked
;
++
loadCount
;
}
...
...
@@ -300,7 +300,7 @@ void PluginView::updatePluginSettings(QTreeWidgetItem *item, int column)
if
(
column
==
C_LOAD
)
{
spec
->
set
LoadOnStartup
(
loadOnStartup
);
spec
->
set
Enabled
(
loadOnStartup
);
toggleRelatedPlugins
(
spec
,
loadOnStartup
);
if
(
item
->
parent
())
{
...
...
@@ -308,7 +308,7 @@ void PluginView::updatePluginSettings(QTreeWidgetItem *item, int column)
Qt
::
CheckState
state
=
Qt
::
PartiallyChecked
;
int
loadCount
=
0
;
for
(
int
i
=
0
;
i
<
collection
->
plugins
().
length
();
++
i
)
{
if
(
collection
->
plugins
().
at
(
i
)
->
loadOnStartup
())
if
(
collection
->
plugins
().
at
(
i
)
->
isEnabled
())
++
loadCount
;
}
if
(
loadCount
==
collection
->
plugins
().
length
())
...
...
@@ -329,7 +329,7 @@ void PluginView::updatePluginSettings(QTreeWidgetItem *item, int column)
QTreeWidgetItem
*
child
=
m_specToItem
.
value
(
spec
);
if
(
!
m_whitelist
.
contains
(
spec
->
name
()))
{
spec
->
set
LoadOnStartup
(
loadOnStartup
);
spec
->
set
Enabled
(
loadOnStartup
);
Qt
::
CheckState
state
=
(
loadOnStartup
?
Qt
::
Checked
:
Qt
::
Unchecked
);
child
->
setData
(
C_LOAD
,
Qt
::
CheckStateRole
,
state
);
toggleRelatedPlugins
(
spec
,
loadOnStartup
);
...
...
src/plugins/coreplugin/plugindialog.cpp
View file @
3319797d
...
...
@@ -111,8 +111,8 @@ void PluginDialog::updateButtons()
if
(
selectedSpec
)
{
m_detailsButton
->
setEnabled
(
true
);
m_errorDetailsButton
->
setEnabled
(
selectedSpec
->
hasError
()
||
selectedSpec
->
i
gnoreOnStartup
()
||
!
selectedSpec
->
loadOnStartup
());
||
selectedSpec
->
i
sDisabledByDependency
()
||
!
selectedSpec
->
isEnabled
());
}
else
{
m_detailsButton
->
setEnabled
(
false
);
m_errorDetailsButton
->
setEnabled
(
false
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment