Commit abf27cd6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compiles with strict definition

parent cfdb4fb0
......@@ -15,7 +15,10 @@ include(KDECompilerSettings NO_POLICY_SCOPE)
include(GenerateExportHeader)
include(ECMQMLModules)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Widgets Quick Qml QuickWidgets
......
......@@ -53,7 +53,7 @@ SettingsBase::SettingsBase( QWidget * parent )
// Prepare the view area
stackedWidget = new QStackedWidget( this );
setWindowTitle(i18n("System Settings"));
setWindowIcon(QIcon::fromTheme("preferences-system"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system")));
setCentralWidget(stackedWidget);
setWindowFlags( windowFlags() | Qt::WindowContextHelpButtonHint );
// Initialise search
......@@ -85,9 +85,9 @@ QSize SettingsBase::sizeHint() const
void SettingsBase::initApplication()
{
// Prepare the menu of all modules
categories = KServiceTypeTrader::self()->query("SystemSettingsCategory");
modules = KServiceTypeTrader::self()->query("KCModule", "[X-KDE-System-Settings-Parent-Category] != ''");
modules += KServiceTypeTrader::self()->query("SystemSettingsExternalApp");
categories = KServiceTypeTrader::self()->query(QStringLiteral("SystemSettingsCategory"));
modules = KServiceTypeTrader::self()->query(QStringLiteral("KCModule"), QStringLiteral("[X-KDE-System-Settings-Parent-Category] != ''"));
modules += KServiceTypeTrader::self()->query(QStringLiteral("SystemSettingsExternalApp"));
rootModule = new MenuItem( true, nullptr );
initMenuList(rootModule);
// Handle lost+found modules...
......@@ -103,7 +103,7 @@ void SettingsBase::initApplication()
// Prepare the Base Data
BaseData::instance()->setMenuItem( rootModule );
// Load all possible views
const KService::List pluginObjects = KServiceTypeTrader::self()->query( "SystemSettingsView" );
const KService::List pluginObjects = KServiceTypeTrader::self()->query( QStringLiteral("SystemSettingsView") );
const int nbPlugins = pluginObjects.count();
for( int pluginsDone = 0; pluginsDone < nbPlugins ; ++pluginsDone ) {
KService::Ptr activeService = pluginObjects.at( pluginsDone );
......@@ -117,7 +117,7 @@ void SettingsBase::initApplication()
connect(searchText, &KLineEdit::textChanged, controller, &BaseMode::searchChanged);
connect(controller, &BaseMode::viewChanged, this, &SettingsBase::viewChange);
} else {
qWarning() << "View load error: " + error;
qWarning() << QStringLiteral("View load error: ") + error;
}
}
searchText->completionObject()->setIgnoreCase( true );
......@@ -130,31 +130,31 @@ void SettingsBase::initToolBar()
{
// Fill the toolbar with default actions
// Exit is the very last action
quitAction = actionCollection()->addAction( KStandardAction::Quit, "quit_action", this, SLOT(close()) );
quitAction = actionCollection()->addAction( KStandardAction::Quit, QStringLiteral("quit_action"), this, SLOT(close()) );
// Configure goes at the end
configureAction = actionCollection()->addAction( KStandardAction::Preferences, "configure", this, SLOT(configShow()) );
configureAction = actionCollection()->addAction( KStandardAction::Preferences, QStringLiteral("configure"), this, SLOT(configShow()) );
actionCollection()->setDefaultShortcut(configureAction, QKeySequence(Qt::CTRL + Qt::Key_M));
configureAction->setText( i18n("Configure") );
// Help after it
initHelpMenu();
configureAction->setIcon(QIcon::fromTheme("application-menu"));
configureAction->setIcon(QIcon::fromTheme(QStringLiteral("application-menu")));
// Then a spacer so the search line-edit is kept separate
spacerAction = new QWidgetAction( this );
spacerAction->setDefaultWidget(spacerWidget);
actionCollection()->addAction( "spacer", spacerAction );
actionCollection()->addAction( QStringLiteral("spacer"), spacerAction );
// Finally the search line-edit
searchAction = new QWidgetAction( this );
searchAction->setDefaultWidget(searchText);
actionCollection()->setDefaultShortcut(searchAction, QKeySequence(Qt::CTRL + Qt::Key_F));
connect( searchAction, SIGNAL(triggered(bool)), searchText, SLOT(setFocus()));
actionCollection()->addAction( "searchText", searchAction );
actionCollection()->addAction( QStringLiteral("searchText"), searchAction );
// Initialise the Window
setupGUI(Save|Create,QString());
menuBar()->hide();
// Toolbar & Configuration
helpActionMenu->setMenu( dynamic_cast<QMenu*>( factory()->container("help", this) ) );
helpActionMenu->setMenu( dynamic_cast<QMenu*>( factory()->container(QStringLiteral("help"), this) ) );
setMinimumSize(620,430);
toolBar()->setMovable(false); // We don't allow any changes
changeToolBar( BaseMode::Search | BaseMode::Configure );
......@@ -162,19 +162,19 @@ void SettingsBase::initToolBar()
void SettingsBase::initHelpMenu()
{
helpActionMenu = new KActionMenu( QIcon::fromTheme("help-contents"), i18n("Help"), this );
helpActionMenu = new KActionMenu( QIcon::fromTheme(QStringLiteral("help-contents")), i18n("Help"), this );
helpActionMenu->setDelayed( false );
actionCollection()->addAction( "help_toolbar_menu", helpActionMenu );
actionCollection()->addAction( QStringLiteral("help_toolbar_menu"), helpActionMenu );
// Add the custom actions
aboutModuleAction = actionCollection()->addAction( KStandardAction::AboutApp, "help_about_module", this, SLOT(about()) );
aboutModuleAction = actionCollection()->addAction( KStandardAction::AboutApp, QStringLiteral("help_about_module"), this, SLOT(about()) );
changeAboutMenu( 0, aboutModuleAction, i18n("About Active Module") );
aboutViewAction = actionCollection()->addAction( KStandardAction::AboutApp, "help_about_view", this, SLOT(about()) );
aboutViewAction = actionCollection()->addAction( KStandardAction::AboutApp, QStringLiteral("help_about_view"), this, SLOT(about()) );
}
void SettingsBase::initConfig()
{
// Prepare dialog first
configDialog = new KConfigDialog( this, "systemsettingsconfig", BaseConfig::self() );
configDialog = new KConfigDialog( this, QStringLiteral("systemsettingsconfig"), BaseConfig::self() );
configDialog->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
// Add our page
......@@ -202,14 +202,14 @@ void SettingsBase::initMenuList(MenuItem * parent)
// look for any categories inside this level, and recurse into them
for (int i = 0; i < categories.size(); ++i) {
const KService::Ptr entry = categories.at(i);
const QString parentCategory = entry->property("X-KDE-System-Settings-Parent-Category").toString();
const QString parentCategory2 = entry->property("X-KDE-System-Settings-Parent-Category-V2").toString();
const QString parentCategory = entry->property(QStringLiteral("X-KDE-System-Settings-Parent-Category")).toString();
const QString parentCategory2 = entry->property(QStringLiteral("X-KDE-System-Settings-Parent-Category-V2")).toString();
if ( parentCategory == parent->category() ||
// V2 entries must not be empty if they want to become a proper category.
( !parentCategory2.isEmpty() && parentCategory2 == parent->category() ) ) {
MenuItem * menuItem = new MenuItem(true, parent);
menuItem->setService( entry );
if( menuItem->category() == "lost-and-found" ) {
if( menuItem->category() == QLatin1String("lost-and-found") ) {
lostFound = menuItem;
continue;
}
......@@ -222,8 +222,8 @@ void SettingsBase::initMenuList(MenuItem * parent)
// scan for any modules at this level and add them
for (int i = 0; i < modules.size(); ++i) {
const KService::Ptr entry = modules.at(i);
const QString category = entry->property("X-KDE-System-Settings-Parent-Category").toString();
const QString category2 = entry->property("X-KDE-System-Settings-Parent-Category-V2").toString();
const QString category = entry->property(QStringLiteral("X-KDE-System-Settings-Parent-Category")).toString();
const QString category2 = entry->property(QStringLiteral("X-KDE-System-Settings-Parent-Category-V2")).toString();
if( !parent->category().isEmpty() && (category == parent->category() || category2 == parent->category()) ) {
if (!entry->noDisplay() ) {
// Add the module info to the menu
......@@ -366,8 +366,8 @@ void SettingsBase::viewChange(bool state)
void SettingsBase::updateViewActions()
{
guiFactory()->unplugActionList( this, "viewActions" );
guiFactory()->plugActionList( this, "viewActions", activeView->actionsList() );
guiFactory()->unplugActionList( this, QStringLiteral("viewActions") );
guiFactory()->plugActionList( this, QStringLiteral("viewActions"), activeView->actionsList() );
}
void SettingsBase::changeToolBar( BaseMode::ToolBarItems toolbar )
......@@ -375,23 +375,23 @@ void SettingsBase::changeToolBar( BaseMode::ToolBarItems toolbar )
if( sender() != activeView ) {
return;
}
guiFactory()->unplugActionList( this, "configure" );
guiFactory()->unplugActionList( this, "search" );
guiFactory()->unplugActionList( this, "quit" );
guiFactory()->unplugActionList( this, QStringLiteral("configure") );
guiFactory()->unplugActionList( this, QStringLiteral("search") );
guiFactory()->unplugActionList( this, QStringLiteral("quit") );
if ( BaseMode::Search & toolbar ) {
QList<QAction*> searchBarActions;
searchBarActions << spacerAction << searchAction;
guiFactory()->plugActionList( this, "search", searchBarActions );
guiFactory()->plugActionList( this, QStringLiteral("search"), searchBarActions );
}
if ( BaseMode::Configure & toolbar ) {
QList<QAction*> configureBarActions;
configureBarActions << configureAction;
guiFactory()->plugActionList( this, "configure", configureBarActions );
guiFactory()->plugActionList( this, QStringLiteral("configure"), configureBarActions );
}
if ( BaseMode::Quit & toolbar ) {
QList<QAction*> quitBarActions;
quitBarActions << quitAction;
guiFactory()->plugActionList( this, "quit", quitBarActions );
guiFactory()->plugActionList( this, QStringLiteral("quit"), quitBarActions );
}
toolBar()->setVisible(toolbar != BaseMode::NoItems || (activeView && activeView->actionsList().count() > 0));
......
......@@ -25,7 +25,7 @@ SystemSettingsApp::SystemSettingsApp(int& argc, char* argv[])
: QApplication(argc, argv)
, window(nullptr)
{
setOrganizationDomain("kde.org");
setOrganizationDomain(QStringLiteral("kde.org"));
KDBusService* service = new KDBusService(KDBusService::Unique, this);
QObject::connect(service, &KDBusService::activateRequested, this, [=]() {
KWindowSystem::forceActiveWindow(window->winId());
......
......@@ -178,12 +178,12 @@ QLayout * ToolTipManager::generateToolTipLine( QModelIndex * item, QWidget * too
QString text = menuItem->name();
if ( comment ) {
text = QString( "<b>%1</b>" ).arg( menuItem->name() );
text = QStringLiteral( "<b>%1</b>" ).arg( menuItem->name() );
}
// Generate text
if ( comment ) {
text += "<br />";
text += QStringLiteral("<br />");
if ( !menuItem->service()->comment().isEmpty() ) {
text += menuItem->service()->comment();
} else {
......
......@@ -31,16 +31,16 @@ int main( int argc, char *argv[] )
{
//exec is systemsettings5, but we need the QPT to use the right config from the qApp constructor
//which is before KAboutData::setApplicationData
QCoreApplication::setApplicationName("systemsettings");
QCoreApplication::setApplicationName(QStringLiteral("systemsettings"));
SystemSettingsApp application(argc, argv);
KLocalizedString::setApplicationDomain("systemsettings");
// About data
KAboutData aboutData("systemsettings", i18n("System Settings"), PROJECT_VERSION, i18n("Central configuration center by KDE."), KAboutLicense::GPL, i18n("(c) 2009, Ben Cooksley"));
aboutData.addAuthor(i18n("Ben Cooksley"), i18n("Maintainer"), "bcooksley@kde.org");
aboutData.addAuthor(i18n("Mathias Soeken"), i18n("Developer"), "msoeken@informatik.uni-bremen.de");
aboutData.addAuthor(i18n("Will Stephenson"), i18n("Internal module representation, internal module model"), "wstephenson@kde.org");
KAboutData aboutData(QStringLiteral("systemsettings"), i18n("System Settings"), QString::fromLatin1(PROJECT_VERSION), i18n("Central configuration center by KDE."), KAboutLicense::GPL, i18n("(c) 2009, Ben Cooksley"));
aboutData.addAuthor(i18n("Ben Cooksley"), i18n("Maintainer"), QStringLiteral("bcooksley@kde.org"));
aboutData.addAuthor(i18n("Mathias Soeken"), i18n("Developer"), QStringLiteral("msoeken@informatik.uni-bremen.de"));
aboutData.addAuthor(i18n("Will Stephenson"), i18n("Internal module representation, internal module model"), QStringLiteral("wstephenson@kde.org"));
if (qEnvironmentVariableIsSet("KDE_FULL_SESSION")) {
aboutData.setDesktopFileName(QStringLiteral("systemsettings"));
......@@ -51,7 +51,7 @@ int main( int argc, char *argv[] )
KAboutData::setApplicationData(aboutData);
application.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
application.setWindowIcon(QIcon::fromTheme("preferences-system"));
application.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system")));
QCommandLineParser parser;
parser.addHelpOption();
parser.addVersionOption();
......
......@@ -85,14 +85,14 @@ void CategoryList::updatePixmap()
KIconLoader * iconL = KIconLoader::global();
d->itemMap.clear();
const QString templatePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "systemsettings/classic/main.html" );
const QString templatePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("systemsettings/classic/main.html") );
QFile templateFile( templatePath );
templateFile.open( QIODevice::ReadOnly );
QTextStream templateText( &templateFile );
QString templateString = templateText.readAll();
templateString = templateString.arg( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kf5/infopage/kde_infopage.css" ) );
templateString = templateString.arg( QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kf5/infopage/kde_infopage.css") ) );
if ( qApp->layoutDirection() == Qt::RightToLeft ) {
templateString = templateString.arg( "@import \"%1\";" ).arg( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kf5/infopage/kde_infopage_rtl.css" ) );
templateString = templateString.arg( QStringLiteral("@import \"%1\";") ).arg( QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kf5/infopage/kde_infopage_rtl.css") ) );
} else {
templateString = templateString.arg( QString() );
}
......@@ -102,18 +102,18 @@ void CategoryList::updatePixmap()
if ( d->categoryMenu.isValid() ) {
moduleName = d->itemModel->data( d->categoryMenu, Qt::DisplayRole ).toString();
}
content += "<div id=\"tableTitle\">" + moduleName + "</div>";
content += "<table class=\"kc_table\">\n";
content += QStringLiteral("<div id=\"tableTitle\">") + moduleName + QStringLiteral("</div>");
content += QStringLiteral("<table class=\"kc_table\">\n");
for( int done = 0; d->itemModel->rowCount( d->categoryMenu ) > done; ++done ) {
QModelIndex childIndex = d->itemModel->index( done, 0, d->categoryMenu );
MenuItem *childItem = d->itemModel->data( childIndex, Qt::UserRole ).value<MenuItem*>();
const QString url = QLatin1String("kcm:///") + childItem->item().fileName();
QUrl link(url);
const QString szLink = "<a href=\"" + link.url() + "\" >";
content += "<tr><td class=\"kc_leftcol\">" + szLink + "<img src=\"%1\" width=\"24\" height=\"24\"></a></td><td class=\"kc_middlecol\">";
const QString szLink = QStringLiteral("<a href=\"") + link.url() + QStringLiteral("\" >");
content += QStringLiteral("<tr><td class=\"kc_leftcol\">") + szLink + QStringLiteral("<img src=\"%1\" width=\"24\" height=\"24\"></a></td><td class=\"kc_middlecol\">");
const QString szName = childItem->name();
const QString szComment = childItem->service()->comment();
content += szLink + szName + "</a></td><td class=\"kc_rightcol\">" + szLink + szComment + "</a>";
content += szLink + szName + QStringLiteral("</a></td><td class=\"kc_rightcol\">") + szLink + szComment + QStringLiteral("</a>");
//passing just the path is insufficient as some icon sets (breeze) only provide SVGs
//instead pass data inline
......@@ -125,13 +125,13 @@ void CategoryList::updatePixmap()
image.save(&buffer, "PNG"); // writes the image in PNG format inside the buffer
QString iconBase64 = QString::fromLatin1(byteArray.toBase64().data());
content = content.arg("data:image/png;base64," + iconBase64);
content = content.arg(QStringLiteral("data:image/png;base64,") + iconBase64);
d->itemMap.insert( link.url(), childIndex );
content += "</td></tr>\n";
content += QStringLiteral("</td></tr>\n");
}
content += "</table>";
content += QStringLiteral("</table>");
d->categoryView->begin( QUrl::fromLocalFile( templatePath ) );
d->categoryView->write( templateString.arg( content ) );
d->categoryView->end();
......@@ -146,7 +146,7 @@ void CategoryList::changeModule( const QModelIndex &newItem )
void CategoryList::slotModuleLinkClicked( const QUrl& moduleName )
{
QModelIndex module = d->itemMap.value( moduleName.url() );
qDebug() << "Link name: " + moduleName.url();
qDebug() << "Link name: " << moduleName.url();
emit moduleSelected( module );
}
......
......@@ -71,7 +71,7 @@ ClassicMode::ClassicMode( QObject * parent, const QVariantList& )
i18n("(c) 2009, Ben Cooksley"));
d->aboutClassic->addAuthor(i18n("Ben Cooksley"), i18n("Author"), QStringLiteral("bcooksley@kde.org"));
d->aboutClassic->addAuthor(i18n("Mathias Soeken"), i18n("Developer"), QStringLiteral("msoeken@informatik.uni-bremen.de"));
d->aboutClassic->setProgramIconName("view-list-tree");
d->aboutClassic->setProgramIconName(QStringLiteral("view-list-tree"));
}
ClassicMode::~ClassicMode()
......
......@@ -126,10 +126,10 @@ bool MenuItem::menu() const
void MenuItem::setService( const KService::Ptr& service )
{
d->service = service;
d->category = service->property("X-KDE-System-Settings-Category").toString();
d->category = service->property(QStringLiteral("X-KDE-System-Settings-Category")).toString();
d->name = service->name();
d->item = KCModuleInfo( service );
const QVariant itemWeight = service->property( "X-KDE-Weight", QVariant::Int );
const QVariant itemWeight = service->property(QStringLiteral("X-KDE-Weight"), QVariant::Int );
if( itemWeight.isValid() ) {
d->weight = itemWeight.toInt();
} else {
......
......@@ -88,7 +88,7 @@ QVariant MenuModel::data( const QModelIndex &index, int role ) const
break;
case KCategorizedSortFilterProxyModel::CategorySortRole:
if ( mi->parent() ) {
theData.setValue( QString("%1%2").arg( QString::number(mi->parent()->weight()), 5, '0' ).arg( mi->parent()->name() ) );
theData.setValue( QStringLiteral("%1%2").arg( QString::number(mi->parent()->weight()), 5, QLatin1Char('0') ).arg( mi->parent()->name() ) );
}
break;
case KCategorizedSortFilterProxyModel::CategoryDisplayRole:
......@@ -103,7 +103,7 @@ QVariant MenuModel::data( const QModelIndex &index, int role ) const
theData.setValue( mi->keywords().join( QString() ) );
break;
case MenuModel::UserSortRole:
theData.setValue( QString("%1").arg( QString::number(mi->weight()), 5, '0' ) );
theData.setValue( QStringLiteral("%1").arg( QString::number(mi->weight()), 5, QLatin1Char('0') ) );
break;
default:
break;
......
......@@ -84,7 +84,7 @@ bool MenuProxyModel::filterAcceptsRow( int source_row, const QModelIndex &source
QModelIndex index = sourceModel()->index( source_row, 0, source_parent );
MenuItem * mItem = index.data( Qt::UserRole ).value<MenuItem*>();
// accept only systemsettings categories that have children
if ( mItem->children().isEmpty() && mItem->service()->serviceTypes().contains( "SystemSettingsCategory" ) ) {
if ( mItem->children().isEmpty() && mItem->service()->serviceTypes().contains( QStringLiteral("SystemSettingsCategory") ) ) {
return false;
} else {
return true; // Items matching the regexp are disabled, not hidden
......
......@@ -183,7 +183,7 @@ void ModuleView::addModule( KCModuleInfo *module )
KPageWidgetItem *page = new KPageWidgetItem( moduleScroll, module->moduleName() );
// Provide information to the users
if( module->service()->hasServiceType("SystemSettingsExternalApp") || // Is it an external app?
if( module->service()->hasServiceType(QStringLiteral("SystemSettingsExternalApp")) || // Is it an external app?
module->service()->substituteUid() ) { // ...or does it require UID substituion?
QWidget * externalWidget = new ExternalAppModule( this, module );
moduleScroll->setWidget( externalWidget );
......@@ -223,8 +223,8 @@ void ModuleView::updatePageIconHeader( KPageWidgetItem * page, bool light )
}
if( moduleProxy && moduleProxy->realModule()->useRootOnlyMessage() ) {
page->setHeader( moduleInfo->comment() + "<br><small>" + moduleProxy->realModule()->rootOnlyMessage() + "</small>" );
page->setIcon( KDE::icon( moduleInfo->icon(), QStringList() << "dialog-warning" ) );
page->setHeader( moduleInfo->comment() + QStringLiteral("<br><small>") + moduleProxy->realModule()->rootOnlyMessage() + QStringLiteral("</small>") );
page->setIcon( KDE::icon( moduleInfo->icon(), QStringList() << QStringLiteral("dialog-warning") ) );
}
}
......@@ -325,8 +325,8 @@ void ModuleView::moduleHelp()
if( docPath.isEmpty() ) {
return;
}
QUrl url( "help:/"+docPath );
QProcess::startDetached("khelpcenter", QStringList() << url.url());
QUrl url( QStringLiteral("help:/")+docPath );
QProcess::startDetached(QStringLiteral("khelpcenter"), QStringList() << url.url());
}
void ModuleView::activeModuleChanged(KPageWidgetItem * current, KPageWidgetItem * previous)
......@@ -346,8 +346,8 @@ void ModuleView::activeModuleChanged(KPageWidgetItem * current, KPageWidgetItem
KCModuleProxy * activeModule = d->mPages.value( d->mPageWidget->currentPage() );
if (activeModule) {
KActivities::ResourceInstance::notifyAccessed(QUrl("kcm:" + activeModule->moduleInfo().service()->storageId()),
"org.kde.systemsettings");
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("kcm:") + activeModule->moduleInfo().service()->storageId()),
QStringLiteral("org.kde.systemsettings"));
}
}
......
......@@ -56,12 +56,12 @@ IconMode::IconMode( QObject *parent, const QVariantList& )
: BaseMode( parent )
, d( new Private() )
{
d->aboutIcon = new KAboutData( "IconView", i18n( "Icon View" ),
"1.0", i18n( "Provides a categorized icons view of control modules." ),
d->aboutIcon = new KAboutData( QStringLiteral("IconView"), i18n( "Icon View" ),
QStringLiteral("1.0"), i18n( "Provides a categorized icons view of control modules." ),
KAboutLicense::GPL, i18n( "(c) 2009, Ben Cooksley" ) );
d->aboutIcon->addAuthor( i18n( "Ben Cooksley" ), i18n( "Author" ), "bcooksley@kde.org" );
d->aboutIcon->addAuthor( i18n( "Mathias Soeken" ), i18n( "Developer" ), "msoeken@informatik.uni-bremen.de" );
d->aboutIcon->setProgramIconName( "view-list-icons" );
d->aboutIcon->addAuthor( i18n( "Ben Cooksley" ), i18n( "Author" ), QStringLiteral("bcooksley@kde.org") );
d->aboutIcon->addAuthor( i18n( "Mathias Soeken" ), i18n( "Developer" ), QStringLiteral("msoeken@informatik.uni-bremen.de") );
d->aboutIcon->setProgramIconName( QStringLiteral("view-list-icons") );
d->backAction = KStandardAction::back( this, SLOT(backToOverview()), this );
d->backAction->setText( i18n( "All Settings" ) );
......
......@@ -256,13 +256,13 @@ SidebarMode::SidebarMode( QObject *parent, const QVariantList& )
, d( new Private() )
{
qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
d->aboutIcon = new KAboutData( "SidebarView", i18n( "Sidebar View" ),
"1.0", i18n( "Provides a categorized sidebar for control modules." ),
d->aboutIcon = new KAboutData( QStringLiteral("SidebarView"), i18n( "Sidebar View" ),
QStringLiteral("1.0"), i18n( "Provides a categorized sidebar for control modules." ),
KAboutLicense::GPL, i18n( "(c) 2017, Marco Martin" ) );
d->aboutIcon->addAuthor( i18n( "Marco Martin" ), i18n( "Author" ), "mart@kde.org" );
d->aboutIcon->addAuthor( i18n( "Ben Cooksley" ), i18n( "Author" ), "bcooksley@kde.org" );
d->aboutIcon->addAuthor( i18n( "Mathias Soeken" ), i18n( "Developer" ), "msoeken@informatik.uni-bremen.de" );
d->aboutIcon->setProgramIconName( "view-sidetree" );
d->aboutIcon->addAuthor( i18n( "Marco Martin" ), i18n( "Author" ), QStringLiteral("mart@kde.org") );
d->aboutIcon->addAuthor( i18n( "Ben Cooksley" ), i18n( "Author" ), QStringLiteral("bcooksley@kde.org") );
d->aboutIcon->addAuthor( i18n( "Mathias Soeken" ), i18n( "Developer" ), QStringLiteral("msoeken@informatik.uni-bremen.de") );
d->aboutIcon->setProgramIconName( QStringLiteral("view-sidetree") );
qmlRegisterType<QAction>();
}
......@@ -466,8 +466,8 @@ void SidebarMode::initWidget()
d->quickWidget->quickWindow()->setTitle(i18n("Sidebar"));
d->quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
d->quickWidget->engine()->rootContext()->setContextProperty("systemsettings", this);
d->package = KPackage::PackageLoader::self()->loadPackage("KPackage/GenericQML");
d->quickWidget->engine()->rootContext()->setContextProperty(QStringLiteral("systemsettings"), this);
d->package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
d->package.setPath(QStringLiteral("org.kde.systemsettings.sidebar"));
d->kdeclarative.setDeclarativeEngine(d->quickWidget->engine());
......@@ -501,8 +501,8 @@ void SidebarMode::initWidget()
d->placeHolderWidget->quickWindow()->setTitle(i18n("Most Used"));
d->placeHolderWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
d->placeHolderWidget->engine()->rootContext()->setContextObject(new KLocalizedContext(d->placeHolderWidget));
d->placeHolderWidget->engine()->rootContext()->setContextProperty("systemsettings", this);
d->placeHolderWidget->setSource(QUrl::fromLocalFile(d->package.filePath("ui", "introPage.qml")));
d->placeHolderWidget->engine()->rootContext()->setContextProperty(QStringLiteral("systemsettings"), this);
d->placeHolderWidget->setSource(QUrl::fromLocalFile(d->package.filePath("ui", QStringLiteral("introPage.qml"))));
connect(d->placeHolderWidget->rootObject(), SIGNAL(focusNextRequest()), d->mainWidget, SLOT(focusNext()));
connect(d->placeHolderWidget->rootObject(), SIGNAL(focusPreviousRequest()), d->mainWidget, SLOT(focusPrevious()));
d->placeHolderWidget->installEventFilter(this);
......@@ -513,7 +513,7 @@ void SidebarMode::initWidget()
d->mainLayout->addWidget( d->placeHolderWidget );
emit changeToolBarItems(BaseMode::NoItems);
d->mostUsedModel->setResultModel(new ResultModel( AllResources | Agent("org.kde.systemsettings") | HighScoredFirst | Limit(5), this));
d->mostUsedModel->setResultModel(new ResultModel( AllResources | Agent(QStringLiteral("org.kde.systemsettings")) | HighScoredFirst | Limit(5), this));
}
bool SidebarMode::eventFilter(QObject* watched, QEvent* event)
......
......@@ -177,12 +177,12 @@ QLayout * ToolTipManager::generateToolTipLine( QModelIndex * item, QWidget * too
QString text = menuItem->name();
if ( comment ) {
text = QString( "<b>%1</b>" ).arg( menuItem->name() );
text = QStringLiteral( "<b>%1</b>" ).arg( menuItem->name() );
}
// Generate text
if ( comment ) {
text += "<br />";
text += QStringLiteral("<br />");
if ( !menuItem->service()->comment().isEmpty() ) {
text += menuItem->service()->comment();
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment