Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Plasma Desktop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
39
Merge Requests
39
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Plasma Desktop
Commits
77946ab8
Commit
77946ab8
authored
Nov 01, 2015
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use QStringLiteral + use new connect api
parent
1fc0d5cb
Changes
125
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
125 changed files
with
1338 additions
and
1338 deletions
+1338
-1338
applets/kickoff/core/applicationmodel.cpp
applets/kickoff/core/applicationmodel.cpp
+20
-20
applets/kickoff/core/favoritesmodel.cpp
applets/kickoff/core/favoritesmodel.cpp
+9
-9
applets/kickoff/core/itemhandlers.cpp
applets/kickoff/core/itemhandlers.cpp
+35
-35
applets/kickoff/core/kickoffabstractmodel.cpp
applets/kickoff/core/kickoffabstractmodel.cpp
+1
-1
applets/kickoff/core/kickoffmodel.cpp
applets/kickoff/core/kickoffmodel.cpp
+1
-1
applets/kickoff/core/kickoffproxymodel.cpp
applets/kickoff/core/kickoffproxymodel.cpp
+1
-1
applets/kickoff/core/krunnermodel.cpp
applets/kickoff/core/krunnermodel.cpp
+14
-14
applets/kickoff/core/leavemodel.cpp
applets/kickoff/core/leavemodel.cpp
+24
-24
applets/kickoff/core/models.cpp
applets/kickoff/core/models.cpp
+7
-7
applets/kickoff/core/processrunner.cpp
applets/kickoff/core/processrunner.cpp
+1
-1
applets/kickoff/core/recentlyusedmodel.cpp
applets/kickoff/core/recentlyusedmodel.cpp
+2
-2
applets/kickoff/core/systemmodel.cpp
applets/kickoff/core/systemmodel.cpp
+22
-22
applets/kickoff/core/urlitemlauncher.cpp
applets/kickoff/core/urlitemlauncher.cpp
+6
-6
applets/pager/plugin/pager.cpp
applets/pager/plugin/pager.cpp
+13
-13
applets/trash/plugin/dirmodel.cpp
applets/trash/plugin/dirmodel.cpp
+16
-16
containments/desktop/plugins/folder/foldermodel.cpp
containments/desktop/plugins/folder/foldermodel.cpp
+58
-58
containments/desktop/plugins/folder/internallibkonq/konq_copytomenu.cpp
...esktop/plugins/folder/internallibkonq/konq_copytomenu.cpp
+7
-7
containments/desktop/plugins/folder/internallibkonq/konq_popupmenu.cpp
...desktop/plugins/folder/internallibkonq/konq_popupmenu.cpp
+38
-38
containments/desktop/plugins/folder/labelgenerator.cpp
containments/desktop/plugins/folder/labelgenerator.cpp
+1
-1
containments/desktop/plugins/folder/mimetypesmodel.cpp
containments/desktop/plugins/folder/mimetypesmodel.cpp
+2
-2
containments/desktop/plugins/folder/placesmodel.cpp
containments/desktop/plugins/folder/placesmodel.cpp
+2
-2
containments/desktop/plugins/folder/positioner.cpp
containments/desktop/plugins/folder/positioner.cpp
+37
-37
containments/desktop/plugins/folder/previewpluginsmodel.cpp
containments/desktop/plugins/folder/previewpluginsmodel.cpp
+1
-1
containments/desktop/plugins/folder/viewpropertiesmenu.cpp
containments/desktop/plugins/folder/viewpropertiesmenu.cpp
+3
-3
imports/activitymanager/switcherbackend.cpp
imports/activitymanager/switcherbackend.cpp
+1
-1
kaccess/kaccess.cpp
kaccess/kaccess.cpp
+1
-1
kcms/access/kcmaccess.cpp
kcms/access/kcmaccess.cpp
+13
-13
kcms/autostart/addscriptdialog.cpp
kcms/autostart/addscriptdialog.cpp
+1
-1
kcms/autostart/autostart.cpp
kcms/autostart/autostart.cpp
+11
-11
kcms/autostart/autostartitem.cpp
kcms/autostart/autostartitem.cpp
+1
-1
kcms/baloo/folderselectionwidget.cpp
kcms/baloo/folderselectionwidget.cpp
+8
-8
kcms/baloo/kcm.cpp
kcms/baloo/kcm.cpp
+17
-17
kcms/colors/colorscm.cpp
kcms/colors/colorscm.cpp
+32
-32
kcms/componentchooser/componentchooser.cpp
kcms/componentchooser/componentchooser.cpp
+11
-11
kcms/componentchooser/componentchooserbrowser.cpp
kcms/componentchooser/componentchooserbrowser.cpp
+6
-6
kcms/componentchooser/componentchooseremail.cpp
kcms/componentchooser/componentchooseremail.cpp
+8
-8
kcms/componentchooser/componentchooserfilemanager.cpp
kcms/componentchooser/componentchooserfilemanager.cpp
+5
-5
kcms/componentchooser/componentchooserterminal.cpp
kcms/componentchooser/componentchooserterminal.cpp
+8
-8
kcms/componentchooser/componentchooserwm.cpp
kcms/componentchooser/componentchooserwm.cpp
+21
-21
kcms/componentchooser/kcm_componentchooser.cpp
kcms/componentchooser/kcm_componentchooser.cpp
+1
-1
kcms/componentchooser/ktimerdialog.cpp
kcms/componentchooser/ktimerdialog.cpp
+1
-1
kcms/cursortheme/xcursor/cursortheme.cpp
kcms/cursortheme/xcursor/cursortheme.cpp
+3
-3
kcms/cursortheme/xcursor/thememodel.cpp
kcms/cursortheme/xcursor/thememodel.cpp
+10
-10
kcms/cursortheme/xcursor/themepage.cpp
kcms/cursortheme/xcursor/themepage.cpp
+29
-29
kcms/cursortheme/xcursor/xcursortheme.cpp
kcms/cursortheme/xcursor/xcursortheme.cpp
+19
-19
kcms/dateandtime/dtime.cpp
kcms/dateandtime/dtime.cpp
+13
-13
kcms/dateandtime/helper.cpp
kcms/dateandtime/helper.cpp
+19
-19
kcms/dateandtime/main.cpp
kcms/dateandtime/main.cpp
+17
-17
kcms/desktoppaths/globalpaths.cpp
kcms/desktoppaths/globalpaths.cpp
+3
-3
kcms/desktoptheme/desktopthemedetails.cpp
kcms/desktoptheme/desktopthemedetails.cpp
+25
-25
kcms/desktoptheme/kcmdesktoptheme.cpp
kcms/desktoptheme/kcmdesktoptheme.cpp
+11
-11
kcms/desktoptheme/thememodel.cpp
kcms/desktoptheme/thememodel.cpp
+3
-3
kcms/emoticons/emoticonslist.cpp
kcms/emoticons/emoticonslist.cpp
+14
-14
kcms/fonts/fonts.cpp
kcms/fonts/fonts.cpp
+7
-7
kcms/formats/kcmformats.cpp
kcms/formats/kcmformats.cpp
+1
-1
kcms/hardware/joystick/caldialog.cpp
kcms/hardware/joystick/caldialog.cpp
+3
-3
kcms/hardware/joystick/joydevice.cpp
kcms/hardware/joystick/joydevice.cpp
+2
-2
kcms/hardware/joystick/joystick.cpp
kcms/hardware/joystick/joystick.cpp
+2
-2
kcms/hardware/joystick/joywidget.cpp
kcms/hardware/joystick/joywidget.cpp
+11
-11
kcms/icons/icons.cpp
kcms/icons/icons.cpp
+31
-31
kcms/icons/iconthemes.cpp
kcms/icons/iconthemes.cpp
+22
-22
kcms/icons/main.cpp
kcms/icons/main.cpp
+7
-7
kcms/kded/kcmkded.cpp
kcms/kded/kcmkded.cpp
+15
-15
kcms/keyboard/bindings.cpp
kcms/keyboard/bindings.cpp
+1
-1
kcms/keyboard/flags.cpp
kcms/keyboard/flags.cpp
+12
-12
kcms/keyboard/iso_codes.cpp
kcms/keyboard/iso_codes.cpp
+1
-1
kcms/keyboard/iso_codes.h
kcms/keyboard/iso_codes.h
+1
-1
kcms/keyboard/kcm_add_layout_dialog.cpp
kcms/keyboard/kcm_add_layout_dialog.cpp
+2
-2
kcms/keyboard/kcm_keyboard.cpp
kcms/keyboard/kcm_keyboard.cpp
+1
-1
kcms/keyboard/kcm_keyboard_widget.cpp
kcms/keyboard/kcm_keyboard_widget.cpp
+32
-32
kcms/keyboard/kcmmisc.cpp
kcms/keyboard/kcmmisc.cpp
+6
-6
kcms/keyboard/keyboard_config.cpp
kcms/keyboard/keyboard_config.cpp
+2
-2
kcms/keyboard/keyboard_daemon.cpp
kcms/keyboard/keyboard_daemon.cpp
+16
-16
kcms/keyboard/keyboard_hardware.cpp
kcms/keyboard/keyboard_hardware.cpp
+3
-3
kcms/keyboard/layout_memory_persister.cpp
kcms/keyboard/layout_memory_persister.cpp
+3
-3
kcms/keyboard/layout_tray_icon.cpp
kcms/keyboard/layout_tray_icon.cpp
+3
-3
kcms/keyboard/layouts_menu.cpp
kcms/keyboard/layouts_menu.cpp
+4
-4
kcms/keyboard/preview/geometry_components.cpp
kcms/keyboard/preview/geometry_components.cpp
+1
-1
kcms/keyboard/preview/geometry_parser.cpp
kcms/keyboard/preview/geometry_parser.cpp
+15
-15
kcms/keyboard/preview/kbpreviewframe.cpp
kcms/keyboard/preview/kbpreviewframe.cpp
+3
-3
kcms/keyboard/preview/keyaliases.cpp
kcms/keyboard/preview/keyaliases.cpp
+18
-18
kcms/keyboard/preview/keysymhelper.cpp
kcms/keyboard/preview/keysymhelper.cpp
+1
-1
kcms/keyboard/preview/symbol_parser.cpp
kcms/keyboard/preview/symbol_parser.cpp
+12
-12
kcms/keyboard/tests/flags_test.cpp
kcms/keyboard/tests/flags_test.cpp
+5
-5
kcms/keyboard/tests/geometry_parser_test.cpp
kcms/keyboard/tests/geometry_parser_test.cpp
+3
-3
kcms/keyboard/tests/iso_codes_test.cpp
kcms/keyboard/tests/iso_codes_test.cpp
+2
-2
kcms/keyboard/tests/xkb_rules_test.cpp
kcms/keyboard/tests/xkb_rules_test.cpp
+33
-33
kcms/keyboard/x11_helper.cpp
kcms/keyboard/x11_helper.cpp
+5
-5
kcms/keyboard/x11_helper.h
kcms/keyboard/x11_helper.h
+1
-1
kcms/keyboard/xkb_helper.cpp
kcms/keyboard/xkb_helper.cpp
+18
-18
kcms/keyboard/xkb_rules.cpp
kcms/keyboard/xkb_rules.cpp
+36
-36
kcms/keys/kglobalshortcutseditor.cpp
kcms/keys/kglobalshortcutseditor.cpp
+13
-13
kcms/keys/select_scheme_dialog.cpp
kcms/keys/select_scheme_dialog.cpp
+3
-3
kcms/knotify/knotify.cpp
kcms/knotify/knotify.cpp
+10
-10
kcms/krdb/krdb.cpp
kcms/krdb/krdb.cpp
+52
-52
kcms/krdb/krdb_clearlibrarypath.cpp
kcms/krdb/krdb_clearlibrarypath.cpp
+6
-6
kcms/ksmserver/smserverconfigimpl.cpp
kcms/ksmserver/smserverconfigimpl.cpp
+9
-9
kcms/ksplash/kcm.cpp
kcms/ksplash/kcm.cpp
+13
-13
kcms/launch/kcmlaunch.cpp
kcms/launch/kcmlaunch.cpp
+9
-9
kcms/lookandfeel/autotests/kcmtest.cpp
kcms/lookandfeel/autotests/kcmtest.cpp
+26
-26
kcms/lookandfeel/kcm.cpp
kcms/lookandfeel/kcm.cpp
+32
-32
kcms/runners/kcm.cpp
kcms/runners/kcm.cpp
+6
-6
kcms/solid_actions/ActionItem.cpp
kcms/solid_actions/ActionItem.cpp
+10
-10
kcms/solid_actions/ActionModel.cpp
kcms/solid_actions/ActionModel.cpp
+1
-1
kcms/solid_actions/DesktopFileGenerator.cpp
kcms/solid_actions/DesktopFileGenerator.cpp
+3
-3
kcms/solid_actions/PredicateItem.cpp
kcms/solid_actions/PredicateItem.cpp
+1
-1
kcms/solid_actions/SolidActionData.cpp
kcms/solid_actions/SolidActionData.cpp
+3
-3
kcms/solid_actions/SolidActions.cpp
kcms/solid_actions/SolidActions.cpp
+7
-7
kcms/standard_actions/standard_actions_module.cpp
kcms/standard_actions/standard_actions_module.cpp
+2
-2
kcms/style/kcmstyle.cpp
kcms/style/kcmstyle.cpp
+56
-56
kcms/style/styleconfdialog.cpp
kcms/style/styleconfdialog.cpp
+1
-1
kcms/translations/kcmtranslations.cpp
kcms/translations/kcmtranslations.cpp
+6
-6
kcms/workspaceoptions/workspaceoptions.cpp
kcms/workspaceoptions/workspaceoptions.cpp
+8
-8
knetattach/knetattach.cpp
knetattach/knetattach.cpp
+9
-9
knetattach/main.cpp
knetattach/main.cpp
+1
-1
lib/kactivities-stats/src/common/database/Database.cpp
lib/kactivities-stats/src/common/database/Database.cpp
+11
-11
lib/kactivities-stats/src/common/database/Database.h
lib/kactivities-stats/src/common/database/Database.h
+3
-3
lib/kactivities-stats/src/common/database/schema/ResourcesDatabaseSchema.cpp
...ts/src/common/database/schema/ResourcesDatabaseSchema.cpp
+15
-15
lib/kactivities-stats/src/lib/stats/cleaning.cpp
lib/kactivities-stats/src/lib/stats/cleaning.cpp
+4
-4
lib/kactivities-stats/src/lib/stats/query.cpp
lib/kactivities-stats/src/lib/stats/query.cpp
+1
-1
lib/kactivities-stats/src/lib/stats/resultmodel.cpp
lib/kactivities-stats/src/lib/stats/resultmodel.cpp
+4
-4
lib/kactivities-stats/src/lib/stats/resultset.cpp
lib/kactivities-stats/src/lib/stats/resultset.cpp
+32
-32
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
+3
-3
solid-device-automounter/kcm/DeviceModel.cpp
solid-device-automounter/kcm/DeviceModel.cpp
+2
-2
solid-device-automounter/kded/DeviceAutomounter.cpp
solid-device-automounter/kded/DeviceAutomounter.cpp
+2
-2
No files found.
applets/kickoff/core/applicationmodel.cpp
View file @
77946ab8
...
...
@@ -140,7 +140,7 @@ public:
void
ApplicationModelPrivate
::
fillNode
(
const
QString
&
_relPath
,
AppNode
*
node
)
{
if
(
_relPath
==
"new/"
)
{
if
(
_relPath
==
QLatin1String
(
"new/"
)
)
{
Q_FOREACH
(
const
QString
&
it
,
newInstalledPrograms
)
{
KService
::
Ptr
p
=
KService
::
serviceByStorageId
(
it
);
...
...
@@ -153,7 +153,7 @@ void ApplicationModelPrivate::fillNode(const QString &_relPath, AppNode *node)
continue
;
}
AppNode
*
newnode
=
new
AppNode
();
newnode
->
icon
=
QIcon
::
fromTheme
(
p
->
icon
(),
QIcon
::
fromTheme
(
"unknown"
));
newnode
->
icon
=
QIcon
::
fromTheme
(
p
->
icon
(),
QIcon
::
fromTheme
(
QStringLiteral
(
"unknown"
)
));
newnode
->
appName
=
p
->
name
();
newnode
->
genericName
=
p
->
genericName
();
newnode
->
desktopEntry
=
p
->
entryPath
();
...
...
@@ -272,7 +272,7 @@ void ApplicationModelPrivate::fillNode(const QString &_relPath, AppNode *node)
AppNode
*
newnode
=
new
AppNode
();
newnode
->
iconName
=
icon
;
newnode
->
icon
=
QIcon
::
fromTheme
(
icon
,
QIcon
::
fromTheme
(
"unknown"
));
newnode
->
icon
=
QIcon
::
fromTheme
(
icon
,
QIcon
::
fromTheme
(
QStringLiteral
(
"unknown"
)
));
newnode
->
appName
=
appName
;
newnode
->
genericName
=
genericName
;
newnode
->
relPath
=
relPath
;
...
...
@@ -292,9 +292,9 @@ void ApplicationModelPrivate::fillNode(const QString &_relPath, AppNode *node)
if
(
showRecentlyInstalled
&&
_relPath
.
isEmpty
()
&&
!
newInstalledPrograms
.
isEmpty
())
{
AppNode
*
newnode
=
new
AppNode
();
newnode
->
icon
=
QIcon
::
fromTheme
(
"chronometer"
);
newnode
->
icon
=
QIcon
::
fromTheme
(
QStringLiteral
(
"chronometer"
)
);
newnode
->
appName
=
i18n
(
"Recently Installed"
);
newnode
->
relPath
=
"new/"
;
newnode
->
relPath
=
QStringLiteral
(
"new/"
)
;
newnode
->
isDir
=
true
;
newnode
->
parent
=
node
;
node
->
children
.
prepend
(
newnode
);
...
...
@@ -325,8 +325,8 @@ ApplicationModel::ApplicationModel(QObject *parent, bool allowSeparators)
setRoleNames
(
roles
);
QDBusConnection
dbus
=
QDBusConnection
::
sessionBus
();
(
void
)
new
KickoffAdaptor
(
this
);
QDBusConnection
::
sessionBus
().
registerObject
(
"/kickoff"
,
this
);
dbus
.
connect
(
QString
(),
"/kickoff"
,
"org.kde.plasma"
,
"reloadMenu"
,
this
,
SLOT
(
reloadMenu
()));
QDBusConnection
::
sessionBus
().
registerObject
(
QStringLiteral
(
"/kickoff"
)
,
this
);
dbus
.
connect
(
QString
(),
QStringLiteral
(
"/kickoff"
),
QStringLiteral
(
"org.kde.plasma"
),
QStringLiteral
(
"reloadMenu"
)
,
this
,
SLOT
(
reloadMenu
()));
connect
(
KSycoca
::
self
(),
SIGNAL
(
databaseChanged
(
QStringList
)),
this
,
SLOT
(
checkSycocaChange
(
QStringList
)));
// TODO: remove me again
...
...
@@ -414,7 +414,7 @@ QVariant ApplicationModel::data(const QModelIndex &index, int role) const
}
case
Kickoff
::
UrlRole
:
if
(
node
->
isDir
)
{
return
QString
::
fromLatin1
(
"applications://%1"
).
arg
(
node
->
desktopEntry
);
return
QString
Literal
(
"applications://%1"
).
arg
(
node
->
desktopEntry
);
}
else
{
return
node
->
desktopEntry
;
}
...
...
@@ -561,7 +561,7 @@ void ApplicationModel::reloadMenu()
void
ApplicationModel
::
checkSycocaChange
(
const
QStringList
&
changes
)
{
if
(
changes
.
contains
(
"services"
)
||
changes
.
contains
(
"apps"
))
{
if
(
changes
.
contains
(
QStringLiteral
(
"services"
))
||
changes
.
contains
(
QStringLiteral
(
"apps"
)
))
{
reloadMenu
();
}
}
...
...
@@ -645,7 +645,7 @@ bool ApplicationModel::createNewProgramListForPath(const QString &relPath)
}
else
if
(
e
->
isType
(
KST_KService
))
{
KService
::
Ptr
s
(
KService
::
Ptr
(
static_cast
<
KService
*>
(
e
.
data
())));
if
(
s
->
isApplication
()
&&
!
s
->
noDisplay
())
{
QString
shortStorageId
=
s
->
storageId
().
remove
(
".desktop"
);
QString
shortStorageId
=
s
->
storageId
().
remove
(
QStringLiteral
(
".desktop"
)
);
QHash
<
QString
,
QDate
>::
Iterator
it_find
=
d
->
seenPrograms
.
find
(
shortStorageId
);
if
(
it_find
==
d
->
seenPrograms
.
end
())
{
seenProgramsChanged
=
true
;
...
...
@@ -695,17 +695,17 @@ QHash<QString, QString> ApplicationModelPrivate::iconNameMap()
{
static
QHash
<
QString
,
QString
>
map
;
if
(
map
.
isEmpty
())
{
map
.
insert
(
"gnome-util"
,
"applications-accessories"
);
map
.
insert
(
QStringLiteral
(
"gnome-util"
),
QStringLiteral
(
"applications-accessories"
)
);
// accessibility Oxygen icon was missing when this list was compiled
map
.
insert
(
"accessibility-directory"
,
"applications-other"
);
map
.
insert
(
"gnome-devel"
,
"applications-development"
);
map
.
insert
(
"package_edutainment"
,
"applications-education"
);
map
.
insert
(
"gnome-joystick"
,
"applications-games"
);
map
.
insert
(
"gnome-graphics"
,
"applications-graphics"
);
map
.
insert
(
"gnome-globe"
,
"applications-internet"
);
map
.
insert
(
"gnome-multimedia"
,
"applications-multimedia"
);
map
.
insert
(
"gnome-applications"
,
"applications-office"
);
map
.
insert
(
"gnome-system"
,
"applications-system"
);
map
.
insert
(
QStringLiteral
(
"accessibility-directory"
),
QStringLiteral
(
"applications-other"
)
);
map
.
insert
(
QStringLiteral
(
"gnome-devel"
),
QStringLiteral
(
"applications-development"
)
);
map
.
insert
(
QStringLiteral
(
"package_edutainment"
),
QStringLiteral
(
"applications-education"
)
);
map
.
insert
(
QStringLiteral
(
"gnome-joystick"
),
QStringLiteral
(
"applications-games"
)
);
map
.
insert
(
QStringLiteral
(
"gnome-graphics"
),
QStringLiteral
(
"applications-graphics"
)
);
map
.
insert
(
QStringLiteral
(
"gnome-globe"
),
QStringLiteral
(
"applications-internet"
)
);
map
.
insert
(
QStringLiteral
(
"gnome-multimedia"
),
QStringLiteral
(
"applications-multimedia"
)
);
map
.
insert
(
QStringLiteral
(
"gnome-applications"
),
QStringLiteral
(
"applications-office"
)
);
map
.
insert
(
QStringLiteral
(
"gnome-system"
),
QStringLiteral
(
"applications-system"
)
);
}
return
map
;
}
...
...
applets/kickoff/core/favoritesmodel.cpp
View file @
77946ab8
...
...
@@ -47,8 +47,8 @@ public:
:
q
(
parent
),
displayOrder
(
NameAfterDescription
)
{
Kdelibs4ConfigMigrator
migrator
(
"plasma"
);
//app name is unused for what we want, but we get a warning otherwise
migrator
.
setConfigFiles
(
QStringList
(
"kickoffrc"
));
Kdelibs4ConfigMigrator
migrator
(
QStringLiteral
(
"plasma"
)
);
//app name is unused for what we want, but we get a warning otherwise
migrator
.
setConfigFiles
(
QStringList
(
QStringLiteral
(
"kickoffrc"
)
));
migrator
.
migrate
();
init
();
...
...
@@ -119,7 +119,7 @@ public:
QString
browser
=
config
.
readPathEntry
(
"BrowserApplication"
,
QString
());
if
(
browser
.
isEmpty
())
{
const
KService
::
Ptr
htmlApp
=
KMimeTypeTrader
::
self
()
->
preferredService
(
Q
Latin1String
(
"text/html"
));
const
KService
::
Ptr
htmlApp
=
KMimeTypeTrader
::
self
()
->
preferredService
(
Q
StringLiteral
(
"text/html"
));
if
(
htmlApp
)
{
browser
=
htmlApp
->
storageId
().
replace
(
QLatin1String
(
".desktop"
),
QString
());
...
...
@@ -134,12 +134,12 @@ public:
// whether it uses the current or a previous name).
// BUG: 351550
applications
<<
browser
<<
"org.kde.kontact"
<<
"kontact"
<<
"org.kde.systemsettings"
<<
"systemsettings"
<<
"org.kde.dolphin"
<<
"dolphin"
<<
"org.kde.ktpcontactlist"
<<
"ktp-contactlist"
<<
"org.kde.kate"
<<
"kate"
<<
"org.kde.discover"
<<
"muon-discover"
<<
"discover"
;
<<
QStringLiteral
(
"org.kde.kontact"
)
<<
QStringLiteral
(
"kontact"
)
<<
QStringLiteral
(
"org.kde.systemsettings"
)
<<
QStringLiteral
(
"systemsettings"
)
<<
QStringLiteral
(
"org.kde.dolphin"
)
<<
QStringLiteral
(
"dolphin"
)
<<
QStringLiteral
(
"org.kde.ktpcontactlist"
)
<<
QStringLiteral
(
"ktp-contactlist"
)
<<
QStringLiteral
(
"org.kde.kate"
)
<<
QStringLiteral
(
"kate"
)
<<
QStringLiteral
(
"org.kde.discover"
)
<<
QStringLiteral
(
"muon-discover"
)
<<
QStringLiteral
(
"discover"
)
;
QList
<
QString
>
desktopFiles
;
...
...
applets/kickoff/core/itemhandlers.cpp
View file @
77946ab8
...
...
@@ -73,46 +73,46 @@ bool LeaveItemHandler::openUrl(const KUrl& url)
{
m_logoutAction
=
url
.
path
().
remove
(
'/'
);
if
(
m_logoutAction
==
"sleep"
)
{
if
(
m_logoutAction
==
QLatin1String
(
"sleep"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
suspendRAM
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
suspendRAM
);
return
true
;
}
else
if
(
m_logoutAction
==
"hibernate"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"hibernate"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
suspendDisk
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
suspendDisk
);
return
true
;
}
else
if
(
m_logoutAction
==
"lock"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"lock"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
lock
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
lock
);
return
true
;
}
else
if
(
m_logoutAction
==
"switch"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"switch"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
switchUser
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
switchUser
);
return
true
;
}
else
if
(
m_logoutAction
==
"logout"
||
m_logoutAction
==
"logoutonly"
||
m_logoutAction
==
"restart"
||
m_logoutAction
==
"shutdown"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"logout"
)
||
m_logoutAction
==
QLatin1String
(
"logoutonly"
)
||
m_logoutAction
==
QLatin1String
(
"restart"
)
||
m_logoutAction
==
QLatin1String
(
"shutdown"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
logout
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
logout
);
return
true
;
}
else
if
(
m_logoutAction
==
"savesession"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"savesession"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
saveSession
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
saveSession
);
return
true
;
}
else
if
(
m_logoutAction
==
"standby"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"standby"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
standby
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
standby
);
return
true
;
}
else
if
(
m_logoutAction
==
"suspendram"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"suspendram"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
suspendRAM
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
suspendRAM
);
return
true
;
}
else
if
(
m_logoutAction
==
"suspenddisk"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"suspenddisk"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
suspendDisk
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
suspendDisk
);
return
true
;
}
else
if
(
m_logoutAction
==
"run"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"run"
)
)
{
// decouple dbus call, otherwise we'll run into a dead-lock
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
runCommand
())
);
QTimer
::
singleShot
(
0
,
this
,
&
LeaveItemHandler
::
runCommand
);
return
true
;
}
...
...
@@ -121,9 +121,9 @@ bool LeaveItemHandler::openUrl(const KUrl& url)
void
LeaveItemHandler
::
runCommand
()
{
if
(
KAuthorized
::
authorize
(
"run_command"
))
{
QString
interface
(
"org.kde.krunner"
);
org
::
kde
::
krunner
::
App
krunner
(
interface
,
"/App"
,
QDBusConnection
::
sessionBus
());
if
(
KAuthorized
::
authorize
(
QStringLiteral
(
"run_command"
)
))
{
QString
interface
(
QStringLiteral
(
"org.kde.krunner"
)
);
org
::
kde
::
krunner
::
App
krunner
(
interface
,
QStringLiteral
(
"/App"
)
,
QDBusConnection
::
sessionBus
());
krunner
.
display
();
}
}
...
...
@@ -133,15 +133,15 @@ void LeaveItemHandler::logout()
KWorkSpace
::
ShutdownConfirm
confirm
=
KWorkSpace
::
ShutdownConfirmDefault
;
KWorkSpace
::
ShutdownType
type
=
KWorkSpace
::
ShutdownTypeNone
;
if
(
m_logoutAction
==
"logout"
||
m_logoutAction
==
"logoutonly"
)
{
if
(
m_logoutAction
==
QLatin1String
(
"logout"
)
||
m_logoutAction
==
QLatin1String
(
"logoutonly"
)
)
{
type
=
KWorkSpace
::
ShutdownTypeNone
;
}
else
if
(
m_logoutAction
==
"lock"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"lock"
)
)
{
qDebug
()
<<
"Locking screen"
;
}
else
if
(
m_logoutAction
==
"switch"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"switch"
)
)
{
qDebug
()
<<
"Switching user"
;
}
else
if
(
m_logoutAction
==
"restart"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"restart"
)
)
{
type
=
KWorkSpace
::
ShutdownTypeReboot
;
}
else
if
(
m_logoutAction
==
"shutdown"
)
{
}
else
if
(
m_logoutAction
==
QLatin1String
(
"shutdown"
)
)
{
type
=
KWorkSpace
::
ShutdownTypeHalt
;
}
...
...
@@ -150,23 +150,23 @@ void LeaveItemHandler::logout()
void
LeaveItemHandler
::
lock
()
{
QString
interface
(
"org.freedesktop.ScreenSaver"
);
org
::
freedesktop
::
ScreenSaver
screensaver
(
interface
,
"/ScreenSaver"
,
QDBusConnection
::
sessionBus
());
QString
interface
(
QStringLiteral
(
"org.freedesktop.ScreenSaver"
)
);
org
::
freedesktop
::
ScreenSaver
screensaver
(
interface
,
QStringLiteral
(
"/ScreenSaver"
)
,
QDBusConnection
::
sessionBus
());
screensaver
.
Lock
();
}
void
LeaveItemHandler
::
switchUser
()
{
QString
interface
(
"org.kde.krunner"
);
org
::
kde
::
krunner
::
App
krunner
(
interface
,
"/App"
,
QDBusConnection
::
sessionBus
());
QString
interface
(
QStringLiteral
(
"org.kde.krunner"
)
);
org
::
kde
::
krunner
::
App
krunner
(
interface
,
QStringLiteral
(
"/App"
)
,
QDBusConnection
::
sessionBus
());
krunner
.
switchUser
();
}
void
LeaveItemHandler
::
saveSession
()
{
QString
interface
(
"org.kde.ksmserver"
);
QString
interface
(
QStringLiteral
(
"org.kde.ksmserver"
)
);
org
::
kde
::
KSMServerInterface
ksmserver
(
interface
,
"/KSMServer"
,
QDBusConnection
::
sessionBus
());
org
::
kde
::
KSMServerInterface
ksmserver
(
interface
,
QStringLiteral
(
"/KSMServer"
)
,
QDBusConnection
::
sessionBus
());
if
(
ksmserver
.
isValid
())
{
ksmserver
.
saveCurrentSession
();
}
...
...
applets/kickoff/core/kickoffabstractmodel.cpp
View file @
77946ab8
...
...
@@ -74,7 +74,7 @@ QMimeData *KickoffAbstractModel::mimeData(const QModelIndexList &indexes) const
QStringList
KickoffAbstractModel
::
mimeTypes
()
const
{
QStringList
types
;
types
<<
Q
Latin1String
(
"text/uri-list"
);
types
<<
Q
StringLiteral
(
"text/uri-list"
);
return
types
;
}
...
...
applets/kickoff/core/kickoffmodel.cpp
View file @
77946ab8
...
...
@@ -82,7 +82,7 @@ QMimeData *KickoffModel::mimeData(const QModelIndexList &indexes) const
QStringList
KickoffModel
::
mimeTypes
()
const
{
QStringList
types
;
types
<<
Q
Latin1String
(
"text/uri-list"
);
types
<<
Q
StringLiteral
(
"text/uri-list"
);
return
types
;
}
...
...
applets/kickoff/core/kickoffproxymodel.cpp
View file @
77946ab8
...
...
@@ -74,7 +74,7 @@ QMimeData *KickoffProxyModel::mimeData(const QModelIndexList &indexes) const
QStringList
KickoffProxyModel
::
mimeTypes
()
const
{
QStringList
types
;
types
<<
Q
Latin1String
(
"text/uri-list"
);
types
<<
Q
StringLiteral
(
"text/uri-list"
);
return
types
;
}
...
...
applets/kickoff/core/krunnermodel.cpp
View file @
77946ab8
...
...
@@ -59,13 +59,13 @@ Plasma::RunnerManager * runnerManager() {
// initializing allowed runners
QStringList
allowed
;
allowed
<<
"places"
<<
"shell"
<<
"services"
<<
"bookmarks"
<<
"recentdocuments"
<<
"locations"
<<
"baloosearch"
;
<<
QStringLiteral
(
"places"
)
<<
QStringLiteral
(
"shell"
)
<<
QStringLiteral
(
"services"
)
<<
QStringLiteral
(
"bookmarks"
)
<<
QStringLiteral
(
"recentdocuments"
)
<<
QStringLiteral
(
"locations"
)
<<
QStringLiteral
(
"baloosearch"
)
;
_runnerManager
->
setAllowedRunners
(
allowed
);
...
...
@@ -111,7 +111,7 @@ KService::Ptr Kickoff::serviceForUrl(const KUrl & url)
// URL path example: services_kde4-kate.desktop
// or: services_firefox.desktop
id
.
remove
(
"services_"
);
id
.
remove
(
QStringLiteral
(
"services_"
)
);
return
KService
::
serviceByStorageId
(
id
);
}
...
...
@@ -178,11 +178,11 @@ KRunnerModel::KRunnerModel(QObject *parent)
,
d
(
new
Private
())
{
connect
(
runnerManager
(),
SIGNAL
(
matchesChanged
(
QList
<
Plasma
::
QueryMatch
>
))
,
&
Plasma
::
RunnerManager
::
matchesChanged
,
this
,
SLOT
(
matchesChanged
(
QList
<
Plasma
::
QueryMatch
>
))
);
&
KRunnerModel
::
matchesChanged
);
UrlItemLauncher
::
addGlobalHandler
(
UrlItemLauncher
::
ProtocolHandler
,
"krunner"
,
new
KRunnerItemHandler
);
UrlItemLauncher
::
addGlobalHandler
(
UrlItemLauncher
::
ProtocolHandler
,
QStringLiteral
(
"krunner"
)
,
new
KRunnerItemHandler
);
}
KRunnerModel
::~
KRunnerModel
()
...
...
@@ -234,7 +234,7 @@ void KRunnerModel::matchesChanged(const QList< Plasma::QueryMatch > & m)
while
(
matches
.
size
())
{
Plasma
::
QueryMatch
match
=
matches
.
takeLast
();
qDebug
()
<<
"matches "
<<
QString
(
"krunner://"
)
+
match
.
runner
()
->
id
()
+
"/"
+
match
.
id
();
qDebug
()
<<
"matches "
<<
QString
Literal
(
"krunner://"
)
+
match
.
runner
()
->
id
()
+
"/"
+
match
.
id
();
QString
mimeUrl
;
if
(
runnerManager
()
->
mimeDataForMatch
(
match
))
{
mimeUrl
=
runnerManager
()
->
mimeDataForMatch
(
match
)
->
urls
().
first
().
toString
();
...
...
@@ -244,7 +244,7 @@ void KRunnerModel::matchesChanged(const QList< Plasma::QueryMatch > & m)
match
.
icon
(),
match
.
text
(),
match
.
subtext
(),
QString
(
"krunner://"
)
+
match
.
runner
()
->
id
()
+
"/"
+
match
.
id
(),
QString
Literal
(
"krunner://"
)
+
match
.
runner
()
->
id
()
+
"/"
+
match
.
id
(),
mimeUrl
)
);
...
...
@@ -258,7 +258,7 @@ Qt::ItemFlags KRunnerModel::flags(const QModelIndex &index) const
if
(
index
.
isValid
())
{
KUrl
url
=
data
(
index
,
UrlRole
).
toString
();
QString
host
=
url
.
host
();
if
(
host
!=
"services"
)
{
if
(
host
!=
QLatin1String
(
"services"
)
)
{
flags
&=
~
(
Qt
::
ItemIsDragEnabled
|
Qt
::
ItemIsDropEnabled
);
}
}
else
{
...
...
applets/kickoff/core/leavemodel.cpp
View file @
77946ab8
...
...
@@ -49,39 +49,39 @@ QStandardItem* LeaveModel::createStandardItem(const QString& url)
//Q_ASSERT(KUrl(url).scheme() == "leave");
QStandardItem
*
item
=
new
QStandardItem
();
const
QString
basename
=
QFileInfo
(
url
).
baseName
();
if
(
basename
==
"logoutonly"
)
{
if
(
basename
==
QLatin1String
(
"logoutonly"
)
)
{
item
->
setText
(
i18n
(
"Log out"
));
item
->
setData
(
i18n
(
"End session"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-log-out"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"lock"
)
{
}
else
if
(
basename
==
QLatin1String
(
"lock"
)
)
{
item
->
setText
(
i18n
(
"Lock"
));
item
->
setData
(
i18n
(
"Lock screen"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-lock-screen"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"switch"
)
{
}
else
if
(
basename
==
QLatin1String
(
"switch"
)
)
{
item
->
setText
(
i18n
(
"Switch user"
));
item
->
setData
(
i18n
(
"Start a parallel session as a different user"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-switch-user"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"shutdown"
)
{
}
else
if
(
basename
==
QLatin1String
(
"shutdown"
)
)
{
item
->
setText
(
i18n
(
"Shut down"
));
item
->
setData
(
i18n
(
"Turn off computer"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-shutdown"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"restart"
)
{
}
else
if
(
basename
==
QLatin1String
(
"restart"
)
)
{
item
->
setText
(
i18nc
(
"Restart computer"
,
"Restart"
));
item
->
setData
(
i18n
(
"Restart computer"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-reboot"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"savesession"
)
{
}
else
if
(
basename
==
QLatin1String
(
"savesession"
)
)
{
item
->
setText
(
i18n
(
"Save Session"
));
item
->
setData
(
i18n
(
"Save current session for next login"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"document-save"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"standby"
)
{
}
else
if
(
basename
==
QLatin1String
(
"standby"
)
)
{
item
->
setText
(
i18nc
(
"Puts the system on standby"
,
"Standby"
));
item
->
setData
(
i18n
(
"Pause without logging out"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-suspend"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"suspenddisk"
)
{
}
else
if
(
basename
==
QLatin1String
(
"suspenddisk"
)
)
{
item
->
setText
(
i18n
(
"Hibernate"
));
item
->
setData
(
i18n
(
"Suspend to disk"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-suspend-hibernate"
,
Kickoff
::
IconNameRole
);
}
else
if
(
basename
==
"suspendram"
)
{
}
else
if
(
basename
==
QLatin1String
(
"suspendram"
)
)
{
item
->
setText
(
i18n
(
"Suspend"
));
item
->
setData
(
i18n
(
"Suspend to RAM"
),
Kickoff
::
SubTitleRole
);
item
->
setData
(
"system-suspend"
,
Kickoff
::
IconNameRole
);
...
...
@@ -107,7 +107,7 @@ LeaveModel::LeaveModel(QObject *parent)
roles
[
Kickoff
::
IconNameRole
]
=
"iconName"
;
setRoleNames
(
roles
);
updateModel
();
Kickoff
::
UrlItemLauncher
::
addGlobalHandler
(
Kickoff
::
UrlItemLauncher
::
ProtocolHandler
,
"leave"
,
new
Kickoff
::
LeaveItemHandler
);
Kickoff
::
UrlItemLauncher
::
addGlobalHandler
(
Kickoff
::
UrlItemLauncher
::
ProtocolHandler
,
QStringLiteral
(
"leave"
)
,
new
Kickoff
::
LeaveItemHandler
);
const
QString
configFile
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericConfigLocation
)
+
"/ksmserverrc"
;
...
...
@@ -142,33 +142,33 @@ void LeaveModel::updateModel()
const
QString
session
=
i18n
(
"Session"
);
// Logout
const
bool
canLogout
=
KAuthorized
::
authorizeKAction
(
"logout"
)
&&
KAuthorized
::
authorize
(
"logout"
);
const
bool
canLogout
=
KAuthorized
::
authorizeKAction
(
QStringLiteral
(
"logout"
))
&&
KAuthorized
::
authorize
(
QStringLiteral
(
"logout"
)
);
if
(
canLogout
)
{
QStandardItem
*
logoutOption
=
createStandardItem
(
"leave:/logoutonly"
);
QStandardItem
*
logoutOption
=
createStandardItem
(
QStringLiteral
(
"leave:/logoutonly"
)
);
logoutOption
->
setData
(
session
,
Kickoff
::
GroupNameRole
);
appendRow
(
logoutOption
);
}
// Lock
if
(
KAuthorized
::
authorizeKAction
(
"lock_screen"
))
{
QStandardItem
*
lockOption
=
createStandardItem
(
"leave:/lock"
);
if
(
KAuthorized
::
authorizeKAction
(
QStringLiteral
(
"lock_screen"
)
))
{
QStandardItem
*
lockOption
=
createStandardItem
(
QStringLiteral
(
"leave:/lock"
)
);
lockOption
->
setData
(
session
,
Kickoff
::
GroupNameRole
);
appendRow
(
lockOption
);
}
// Save Session
if
(
canLogout
)
{
KConfigGroup
c
(
KSharedConfig
::
openConfig
(
"ksmserverrc"
,
KConfig
::
NoGlobals
),
"General"
);
if
(
c
.
readEntry
(
"loginMode"
)
==
"restoreSavedSession"
)
{
QStandardItem
*
saveSessionOption
=
createStandardItem
(
"leave:/savesession"
);
KConfigGroup
c
(
KSharedConfig
::
openConfig
(
QStringLiteral
(
"ksmserverrc"
)
,
KConfig
::
NoGlobals
),
"General"
);
if
(
c
.
readEntry
(
"loginMode"
)
==
QLatin1String
(
"restoreSavedSession"
)
)
{
QStandardItem
*
saveSessionOption
=
createStandardItem
(
QStringLiteral
(
"leave:/savesession"
)
);
saveSessionOption
->
setData
(
session
,
Kickoff
::
GroupNameRole
);
appendRow
(
saveSessionOption
);
}
}
// Switch User
if
(
KDisplayManager
().
isSwitchable
()
&&
KAuthorized
::
authorize
(
Q
Latin1String
(
"switch_user"
)))
{
QStandardItem
*
switchUserOption
=
createStandardItem
(
"leave:/switch"
);
if
(
KDisplayManager
().
isSwitchable
()
&&
KAuthorized
::
authorize
(
Q
StringLiteral
(
"switch_user"
)))
{
QStandardItem
*
switchUserOption
=
createStandardItem
(
QStringLiteral
(
"leave:/switch"
)
);
switchUserOption
->
setData
(
session
,
Kickoff
::
GroupNameRole
);
appendRow
(
switchUserOption
);
}
...
...
@@ -180,19 +180,19 @@ void LeaveModel::updateModel()
const
QString
system
=
i18n
(
"System"
);
QSet
<
Solid
::
PowerManagement
::
SleepState
>
spdMethods
=
Solid
::
PowerManagement
::
supportedSleepStates
();
if
(
spdMethods
.
contains
(
Solid
::
PowerManagement
::
StandbyState
))
{
QStandardItem
*
standbyOption
=
createStandardItem
(
"leave:/standby"
);
QStandardItem
*
standbyOption
=
createStandardItem
(
QStringLiteral
(
"leave:/standby"
)
);
standbyOption
->
setData
(
system
,
Kickoff
::
GroupNameRole
);
appendRow
(
standbyOption
);
}
if
(
spdMethods
.
contains
(
Solid
::
PowerManagement
::
SuspendState
))
{
QStandardItem
*
suspendramOption
=
createStandardItem
(
"leave:/suspendram"
);
QStandardItem
*
suspendramOption
=
createStandardItem
(
QStringLiteral
(
"leave:/suspendram"
)
);
suspendramOption
->
setData
(
system
,
Kickoff
::
GroupNameRole
);
appendRow
(
suspendramOption
);
}
if
(
spdMethods
.
contains
(
Solid
::
PowerManagement
::
HibernateState
))
{
QStandardItem
*
suspenddiskOption
=
createStandardItem
(
"leave:/suspenddisk"
);
QStandardItem
*
suspenddiskOption
=
createStandardItem
(
QStringLiteral
(
"leave:/suspenddisk"
)
);
suspenddiskOption
->
setData
(
system
,
Kickoff
::
GroupNameRole
);
appendRow
(
suspenddiskOption
);
}
...
...
@@ -200,14 +200,14 @@ void LeaveModel::updateModel()
if
(
canLogout
)
{
if
(
KWorkSpace
::
canShutDown
(
KWorkSpace
::
ShutdownConfirmDefault
,
KWorkSpace
::
ShutdownTypeReboot
))
{
// Restart
QStandardItem
*
restartOption
=
createStandardItem
(
"leave:/restart"
);
QStandardItem
*
restartOption
=
createStandardItem
(
QStringLiteral
(
"leave:/restart"
)
);
restartOption
->
setData
(
system
,
Kickoff
::
GroupNameRole
);
appendRow
(
restartOption
);
}
if
(
KWorkSpace
::
canShutDown
(
KWorkSpace
::
ShutdownConfirmDefault
,
KWorkSpace
::
ShutdownTypeHalt
))
{
// Shutdown
QStandardItem
*
shutDownOption
=
createStandardItem
(
"leave:/shutdown"
);
QStandardItem
*
shutDownOption
=
createStandardItem
(
QStringLiteral
(
"leave:/shutdown"
)
);
shutDownOption
->
setData
(
system
,
Kickoff
::
GroupNameRole
);
appendRow
(
shutDownOption
);
}
...
...
applets/kickoff/core/models.cpp
View file @
77946ab8
...
...
@@ -83,7 +83,7 @@ QStandardItem *StandardItemFactory::createItemForUrl(const QString& urlString, D
item
=
new
QStandardItem
;
KDesktopFile
desktopFile
(
url
.
toLocalFile
());
item
->
setText
(
QFileInfo
(
urlString
.
mid
(
0
,
urlString
.
lastIndexOf
(
'.'
))).
completeBaseName
());
item
->
setIcon
(
QIcon
::
fromTheme
(
desktopFile
.
readIcon
(),
QIcon
::
fromTheme
(
"unknown"
)));
item
->
setIcon
(
QIcon
::
fromTheme
(
desktopFile
.
readIcon
(),
QIcon
::
fromTheme
(
QStringLiteral
(
"unknown"
)
)));
//FIXME: desktopUrl is a hack around borkage in KRecentDocuments which
// stores a path in the URL field!
...
...
@@ -101,7 +101,7 @@ QStandardItem *StandardItemFactory::createItemForUrl(const QString& urlString, D
item
->
setData
(
subTitle
,
Kickoff
::
SubTitleRole
);
setSpecialUrlProperties
(
desktopUrl
,
item
);