Commit 8381c955 authored by Laurent Montel's avatar Laurent Montel 😁

convert to QStringLiteral

parent 95c8d959
......@@ -254,7 +254,7 @@ void AgentWidget::showTaskList()
}
QPointer<TextDialog> dlg = new TextDialog(this);
dlg->setWindowTitle(QLatin1String("Resource Task List"));
dlg->setWindowTitle(QStringLiteral("Resource Task List"));
dlg->setText(txt);
dlg->exec();
delete dlg;
......@@ -279,7 +279,7 @@ void AgentWidget::showChangeNotifications()
}
QPointer<TextDialog> dlg = new TextDialog(this);
dlg->setWindowTitle(QLatin1String("Change Notification Log"));
dlg->setWindowTitle(QStringLiteral("Change Notification Log"));
dlg->setText(txt);
dlg->exec();
......@@ -378,7 +378,7 @@ void AgentWidget::cloneAgent(KJob *job)
qCritical() << "call to method" << signature << "failed: " << reply.arguments() << reply.errorMessage();
continue;
}
const QString setterName = QLatin1String("set") + methodName.at(0).toUpper() + methodName.mid(1);
const QString setterName = QStringLiteral("set") + methodName.at(0).toUpper() + methodName.mid(1);
targetIface.call(setterName, reply.arguments().at(0));
}
......
......@@ -32,9 +32,9 @@
int main(int argc, char **argv)
{
Kdelibs4ConfigMigrator migrate(QLatin1String("akonadiconsole"));
migrate.setConfigFiles(QStringList() << QLatin1String("akonadiconsolerc"));
migrate.setUiFiles(QStringList() << QLatin1String("akonadiconsoleui.rc"));
Kdelibs4ConfigMigrator migrate(QStringLiteral("akonadiconsole"));
migrate.setConfigFiles(QStringList() << QStringLiteral("akonadiconsolerc"));
migrate.setUiFiles(QStringList() << QStringLiteral("akonadiconsoleui.rc"));
migrate.migrate();
QApplication app(argc, argv);
......@@ -45,7 +45,7 @@ int main(int argc, char **argv)
KAboutLicense::GPL,
i18n("(c) 2006-2014 the Akonadi developer"),
QStringLiteral("http://pim.kde.org/akonadi/"));
QApplication::setWindowIcon(QIcon::fromTheme(QLatin1String("akonadi")));
QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("akonadi")));
aboutData.addAuthor(i18n("Tobias König"), i18n("Author"), QStringLiteral("tokoe@kde.org"));
aboutData.addAuthor(i18n("Volker Krause"), i18n("Author"), QStringLiteral("vkrause@kde.org"));
KAboutData::setApplicationData(aboutData);
......@@ -56,7 +56,7 @@ int main(int argc, char **argv)
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("remote"), i18n("Connect to an Akonadi remote debugging server"), "server"));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("remote"), i18n("Connect to an Akonadi remote debugging server"), "server"));
KDBusService service;
......
......@@ -55,7 +55,7 @@ KCMAkregatorAppearanceConfig::KCMAkregatorAppearanceConfig(QWidget *parent, cons
connect(m_ui.kcfg_MinimumFontSize, SIGNAL(valueChanged(int)), m_ui.slider_minimumFontSize, SLOT(setValue(int)));
connect(m_ui.kcfg_MediumFontSize, SIGNAL(valueChanged(int)), m_ui.slider_mediumFontSize, SLOT(setValue(int)));
KAboutData *about = new KAboutData(QLatin1String("kcmakrappearanceconfig"),
KAboutData *about = new KAboutData(QStringLiteral("kcmakrappearanceconfig"),
i18n("Configure Feed Reader Appearance"),
QString(), QString(), KAboutLicense::GPL,
i18n("(c), 2004 - 2008 Frank Osterfeld"));
......@@ -64,10 +64,10 @@ KCMAkregatorAppearanceConfig::KCMAkregatorAppearanceConfig(QWidget *parent, cons
setAboutData(about);
m_ui.slider_minimumFontSize->setDisabled(Settings::self()->isImmutable(QLatin1String("MinimumFontSize")));
m_ui.slider_mediumFontSize->setDisabled(Settings::self()->isImmutable(QLatin1String("MediumFontSize")));
m_ui.lbl_MinimumFontSize->setDisabled(Settings::self()->isImmutable(QLatin1String("MinimumFontSize")));
m_ui.lbl_MediumFontSize->setDisabled(Settings::self()->isImmutable(QLatin1String("MediumFontSize")));
m_ui.slider_minimumFontSize->setDisabled(Settings::self()->isImmutable(QStringLiteral("MinimumFontSize")));
m_ui.slider_mediumFontSize->setDisabled(Settings::self()->isImmutable(QStringLiteral("MediumFontSize")));
m_ui.lbl_MinimumFontSize->setDisabled(Settings::self()->isImmutable(QStringLiteral("MinimumFontSize")));
m_ui.lbl_MediumFontSize->setDisabled(Settings::self()->isImmutable(QStringLiteral("MediumFontSize")));
addConfig(Settings::self(), m_widget);
}
......
......@@ -226,7 +226,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
FeedIconManager::self(); // FIXME: registering the icon manager dbus iface here,
// because otherwise we get a deadlock later
m_standardFeedList = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/akregator/data/feeds.opml");
m_standardFeedList = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/akregator/data/feeds.opml");
QFileInfo fileInfo(m_standardFeedList);
QDir().mkpath(fileInfo.absolutePath());
......@@ -235,7 +235,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
// There was already a dummy factory registered.
delete dummyFactory;
}
loadPlugins(QLatin1String("storage")); // FIXME: also unload them!
loadPlugins(QStringLiteral("storage")); // FIXME: also unload them!
m_storage = 0;
Backend::StorageFactory *storageFactory = Backend::StorageFactoryRegistry::self()->getFactory(Settings::archiveBackend());
......@@ -299,7 +299,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
Syndication::FileRetriever::setUserAgent(useragent);
loadPlugins(QLatin1String("extension")); // FIXME: also unload them!
loadPlugins(QStringLiteral("extension")); // FIXME: also unload them!
if (!readCrashProperties()) {
autoReadProperties();
......@@ -505,7 +505,7 @@ void Part::slotSaveFeedList()
// the first time we overwrite the feed list, we create a backup
if (!m_backedUpList) {
const QString backup = localFilePath() + QLatin1String("~");
const QString backup = localFilePath() + QStringLiteral("~");
if (QFile::copy(localFilePath(), backup)) {
m_backedUpList = true;
}
......
......@@ -66,7 +66,7 @@ static QString stripHtml(const QString &html)
{
QString str(html);
//TODO: preserve some formatting, such as line breaks
str.remove(QRegExp(QLatin1String("<[^>]*>"))); // remove tags
str.remove(QRegExp(QStringLiteral("<[^>]*>"))); // remove tags
str = Syndication::resolveEntities(str);
return str.simplified();
}
......
......@@ -100,8 +100,8 @@ MainWindow::MainWindow()
toolboxDock->setFeatures(QDockWidget::AllDockWidgetFeatures);
toolboxDock->setWidget(toolbox);
toolboxDock->setObjectName(QLatin1String("dock_toolbox"));
toolbox->setObjectName(QLatin1String("toolbox"));
toolboxDock->setObjectName(QStringLiteral("dock_toolbox"));
toolbox->setObjectName(QStringLiteral("toolbox"));
this->addDockWidget(Qt::RightDockWidgetArea, toolboxDock);
......@@ -117,7 +117,7 @@ MainWindow::MainWindow()
setupGUI();
toolbox->setVisible(Settings::showToolboxOnStart());
actionCollection()->action(QLatin1String("toggle_toolbox"))->setChecked(Settings::showToolboxOnStart());
actionCollection()->action(QStringLiteral("toggle_toolbox"))->setChecked(Settings::showToolboxOnStart());
setupSystemTray();
......@@ -212,44 +212,44 @@ void MainWindow::setupActions()
KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
// custom menu and menu item
QAction *actNewPost = new QAction(QIcon::fromTheme(QLatin1String("document-new")), i18n("New Post"), this);
actionCollection()->addAction(QLatin1String("new_post"), actNewPost);
QAction *actNewPost = new QAction(QIcon::fromTheme(QStringLiteral("document-new")), i18n("New Post"), this);
actionCollection()->addAction(QStringLiteral("new_post"), actNewPost);
actionCollection()->setDefaultShortcut(actNewPost, QKeySequence(Qt::CTRL + Qt::Key_N));
connect(actNewPost, &QAction::triggered, this, &MainWindow::slotCreateNewPost);
QAction *actAddBlog = new QAction(QIcon::fromTheme(QLatin1String("list-add")), i18n("Add Blog..."), this);
actionCollection()->addAction(QLatin1String("add_blog"), actAddBlog);
QAction *actAddBlog = new QAction(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Add Blog..."), this);
actionCollection()->addAction(QStringLiteral("add_blog"), actAddBlog);
connect(actAddBlog, &QAction::triggered, this, &MainWindow::addBlog);
QAction *actPublish = new QAction(QIcon::fromTheme(QLatin1String("arrow-up")), i18n("Submit..."), this);
actionCollection()->addAction(QLatin1String("publish_post"), actPublish);
QAction *actPublish = new QAction(QIcon::fromTheme(QStringLiteral("arrow-up")), i18n("Submit..."), this);
actionCollection()->addAction(QStringLiteral("publish_post"), actPublish);
connect(actPublish, &QAction::triggered, this, &MainWindow::slotPublishPost);
QAction *actUpload = new QAction(QIcon::fromTheme(QLatin1String("upload-media")), i18n("Upload Media..."), this);
actionCollection()->addAction(QLatin1String("upload_media"), actUpload);
QAction *actUpload = new QAction(QIcon::fromTheme(QStringLiteral("upload-media")), i18n("Upload Media..."), this);
actionCollection()->addAction(QStringLiteral("upload_media"), actUpload);
connect(actUpload, &QAction::triggered, this, &MainWindow::uploadMediaObject);
QAction *actSaveLocally = new QAction(QIcon::fromTheme(QLatin1String("document-save")), i18n("Save Locally"), this);
actionCollection()->addAction(QLatin1String("save_locally"), actSaveLocally);
QAction *actSaveLocally = new QAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("Save Locally"), this);
actionCollection()->addAction(QStringLiteral("save_locally"), actSaveLocally);
actionCollection()->setDefaultShortcut(actSaveLocally, QKeySequence(Qt::CTRL + Qt::Key_S));
connect(actSaveLocally, &QAction::triggered, this, &MainWindow::slotSavePostLocally);
KToggleAction *actToggleToolboxVisible = new KToggleAction(i18n("Show Toolbox"), this);
actionCollection()->addAction(QLatin1String("toggle_toolbox"), actToggleToolboxVisible);
actionCollection()->addAction(QStringLiteral("toggle_toolbox"), actToggleToolboxVisible);
actionCollection()->setDefaultShortcut(actToggleToolboxVisible, QKeySequence(Qt::CTRL + Qt::Key_T));
connect(actToggleToolboxVisible, &KToggleAction::toggled, this, &MainWindow::slotToggleToolboxVisible);
connect(toolboxDock, &QDockWidget::visibilityChanged, this, &MainWindow::slotToolboxVisibilityChanged);
blogs = new KSelectAction(this);
actionCollection()->addAction(QLatin1String("blogs_list"), blogs);
actionCollection()->addAction(QStringLiteral("blogs_list"), blogs);
QAction *actOpenBlog = new QAction(QIcon::fromTheme(QLatin1String("applications-internet")), i18n("Open in browser"), this);
actionCollection()->addAction(QLatin1String("open_blog_in_browser"), actOpenBlog);
QAction *actOpenBlog = new QAction(QIcon::fromTheme(QStringLiteral("applications-internet")), i18n("Open in browser"), this);
actionCollection()->addAction(QStringLiteral("open_blog_in_browser"), actOpenBlog);
actOpenBlog->setToolTip(i18n("Open current blog in browser"));
connect(actOpenBlog, &QAction::triggered, this, &MainWindow::slotOpenCurrentBlogInBrowser);
actionCollection()->addAction(QLatin1String("upload_file"), mStorageManager->menuUploadServices(this));
actionCollection()->addAction(QLatin1String("download_file"), mStorageManager->menuDownloadServices(this));
actionCollection()->addAction(QStringLiteral("upload_file"), mStorageManager->menuUploadServices(this));
actionCollection()->addAction(QStringLiteral("download_file"), mStorageManager->menuDownloadServices(this));
mStorageManager->setDefaultUploadFolder(Settings::self()->downloadDirectory());
}
......@@ -340,10 +340,10 @@ void MainWindow::optionsPreferences()
// compare the names of the widgets in the .ui file
// to the names of the variables in the .kcfg file
//avoid having 2 dialogs shown
if (KConfigDialog::showDialog(QLatin1String("settings"))) {
if (KConfigDialog::showDialog(QStringLiteral("settings"))) {
return;
}
ConfigureDialog *dialog = new ConfigureDialog(mStorageManager, this, QLatin1String("settings"), Settings::self());
ConfigureDialog *dialog = new ConfigureDialog(mStorageManager, this, QStringLiteral("settings"), Settings::self());
connect(dialog, &ConfigureDialog::blogAdded, this, &MainWindow::slotBlogAdded);
connect(dialog, &ConfigureDialog::blogEdited, this, &MainWindow::slotBlogEdited);
connect(dialog, &ConfigureDialog::blogRemoved, this, &MainWindow::slotBlogRemoved);
......@@ -424,9 +424,9 @@ void MainWindow::setupSystemTray()
if (Settings::enableSysTrayIcon()) {
if (!systemTray) {
systemTray = new KStatusNotifierItem(this);
systemTray->setIconByName(QLatin1String("blogilo"));
systemTray->setToolTip(QLatin1String("blogilo"), i18n("Blogilo"), i18n("A KDE Blogging Client"));
systemTray->contextMenu()->addAction(actionCollection()->action(QLatin1String("new_post")));
systemTray->setIconByName(QStringLiteral("blogilo"));
systemTray->setToolTip(QStringLiteral("blogilo"), i18n("Blogilo"), i18n("A KDE Blogging Client"));
systemTray->contextMenu()->addAction(actionCollection()->action(QStringLiteral("new_post")));
systemTray->setCategory(KStatusNotifierItem::ApplicationStatus);
systemTray->setStatus(KStatusNotifierItem::Active);
}
......@@ -449,7 +449,7 @@ void MainWindow::slotToggleToolboxVisible(bool isVisible)
void MainWindow::slotToolboxVisibilityChanged(bool)
{
actionCollection()->action(QLatin1String("toggle_toolbox"))->setChecked(toolboxDock->isVisibleTo(this));
actionCollection()->action(QStringLiteral("toggle_toolbox"))->setChecked(toolboxDock->isVisibleTo(this));
}
void MainWindow::slotActivePostChanged(int index)
......@@ -616,7 +616,7 @@ void MainWindow::postManipulationDone(bool isError, const QString &customMessage
PostEntry *entry = qobject_cast<PostEntry *>(sender());
if (entry) {
if (KMessageBox::questionYesNo(this, i18n("%1\nDo you want to keep the post open?", customMessage),
QString(), KStandardGuiItem::yes(), KStandardGuiItem::no(), QLatin1String("KeepPostOpen")) == KMessageBox::No) {
QString(), KStandardGuiItem::yes(), KStandardGuiItem::no(), QStringLiteral("KeepPostOpen")) == KMessageBox::No) {
slotRemovePostEntry(tabPosts->indexOf(entry));
} else {
toolbox->setFieldsValue(entry->currentPost());
......
......@@ -35,7 +35,7 @@ PostsTabWidget::PostsTabWidget(QWidget *parent)
setMovable(true);
mNewTabButton = new QToolButton(this);
mNewTabButton->setIcon(QIcon::fromTheme(QLatin1String("tab-new")));
mNewTabButton->setIcon(QIcon::fromTheme(QStringLiteral("tab-new")));
mNewTabButton->adjustSize();
mNewTabButton->setToolTip(i18nc("@info:tooltip", "Open a new tab"));
#ifndef QT_NO_ACCESSIBILITY
......@@ -45,7 +45,7 @@ PostsTabWidget::PostsTabWidget(QWidget *parent)
connect(mNewTabButton, &QToolButton::clicked, this, &PostsTabWidget::createNewPost);
mCloseTabButton = new QToolButton(this);
mCloseTabButton->setIcon(QIcon::fromTheme(QLatin1String("tab-close")));
mCloseTabButton->setIcon(QIcon::fromTheme(QStringLiteral("tab-close")));
mCloseTabButton->adjustSize();
mCloseTabButton->setToolTip(i18nc("@info:tooltip", "Close the current tab"));
#ifndef QT_NO_ACCESSIBILITY
......@@ -76,11 +76,11 @@ void PostsTabWidget::slotTabContextMenuRequest(const QPoint &pos)
QMenu menu(this);
QAction *closeTab = menu.addAction(i18nc("@action:inmenu", "Close Tab"));
closeTab->setIcon(QIcon::fromTheme(QLatin1String("tab-close")));
closeTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-close")));
QAction *allOther = menu.addAction(i18nc("@action:inmenu", "Close All Other Tabs"));
allOther->setEnabled(count() > 1);
allOther->setIcon(QIcon::fromTheme(QLatin1String("tab-close-other")));
allOther->setIcon(QIcon::fromTheme(QStringLiteral("tab-close-other")));
QAction *action = menu.exec(mapToGlobal(pos));
......
......@@ -31,9 +31,9 @@
int main(int argc, char **argv)
{
Kdelibs4ConfigMigrator migrate(QLatin1String("storageservice"));
migrate.setConfigFiles(QStringList() << QLatin1String("storageservicerc") << QLatin1String("storageservicemanager.notifyrc"));
migrate.setUiFiles(QStringList() << QLatin1String("storageserviceui.rc"));
Kdelibs4ConfigMigrator migrate(QStringLiteral("storageservice"));
migrate.setConfigFiles(QStringList() << QStringLiteral("storageservicerc") << QStringLiteral("storageservicemanager.notifyrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("storageserviceui.rc"));
migrate.migrate();
QApplication app(argc, argv);
......@@ -44,9 +44,9 @@ int main(int argc, char **argv)
i18n("Storage Service Manager"),
KAboutLicense::GPL_V2,
i18n("Copyright © 2013-2015 storageservicemanager authors"));
aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QLatin1String("montel@kde.org"));
aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("montel@kde.org"));
QApplication::setWindowIcon(QIcon::fromTheme(QLatin1String("kmail")));
QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail")));
KAboutData::setApplicationData(aboutData);
QCommandLineParser parser;
......
......@@ -79,7 +79,7 @@ void StorageServiceLogDialog::slotClearLog()
void StorageServiceLogDialog::slotSaveAs()
{
const QString filter = QLatin1String("*|") + i18n("all files (*)");
const QString filter = QStringLiteral("*|") + i18n("all files (*)");
PimCommon::Util::saveTextAs(mLog->toPlainText(), filter, this, QUrl(), i18n("Save Log"));
}
......@@ -92,7 +92,7 @@ void StorageServiceLogDialog::writeConfig()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup group = config->group(QLatin1String("StorageServiceLogDialog"));
KConfigGroup group = config->group(QStringLiteral("StorageServiceLogDialog"));
group.writeEntry("Size", size());
}
......
......@@ -100,10 +100,10 @@ void StorageServiceTreeWidget::createMenuActions(QMenu *menu)
if (type != StorageServiceTreeWidget::UnKnown) {
if (type == StorageServiceTreeWidget::File) {
if (mCapabilities & PimCommon::StorageServiceAbstract::MoveFileCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-cut")), i18n("Cut"), this, SLOT(slotCutFile()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-cut")), i18n("Cut"), this, SLOT(slotCutFile()));
}
if (mCapabilities & PimCommon::StorageServiceAbstract::CopyFileCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-copy")), i18n("Copy"), this, SLOT(slotCopyFile()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18n("Copy"), this, SLOT(slotCopyFile()));
}
QAction *act = new QAction(menu);
act->setSeparator(true);
......@@ -118,20 +118,20 @@ void StorageServiceTreeWidget::createMenuActions(QMenu *menu)
act->setSeparator(true);
menu->addAction(act);
if (mCapabilities & PimCommon::StorageServiceAbstract::DownloadFileCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("download")), i18n("Download File"), this, SIGNAL(downloadFile()));
menu->addAction(QIcon::fromTheme(QStringLiteral("download")), i18n("Download File"), this, SIGNAL(downloadFile()));
}
act = new QAction(menu);
act->setSeparator(true);
menu->addAction(act);
if (mCapabilities & PimCommon::StorageServiceAbstract::DeleteFileCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18n("Delete File"), this, SLOT(slotDeleteFile()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete File"), this, SLOT(slotDeleteFile()));
}
} else if (type == StorageServiceTreeWidget::Folder) {
if (mCapabilities & PimCommon::StorageServiceAbstract::MoveFolderCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-cut")), i18n("Cut"), this, SLOT(slotCutFolder()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-cut")), i18n("Cut"), this, SLOT(slotCutFolder()));
}
if (mCapabilities & PimCommon::StorageServiceAbstract::CopyFolderCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-copy")), i18n("Copy"), this, SLOT(slotCopyFolder()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18n("Copy"), this, SLOT(slotCopyFolder()));
}
QAction *act = new QAction(menu);
act->setSeparator(true);
......@@ -143,7 +143,7 @@ void StorageServiceTreeWidget::createMenuActions(QMenu *menu)
act->setSeparator(true);
menu->addAction(act);
if (mCapabilities & PimCommon::StorageServiceAbstract::DeleteFolderCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18n("Delete Folder"), this, SLOT(slotDeleteFolder()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete Folder"), this, SLOT(slotDeleteFolder()));
}
}
}
......@@ -157,7 +157,7 @@ void StorageServiceTreeWidget::createMenuActions(QMenu *menu)
act->setSeparator(true);
menu->addAction(act);
if (mCapabilities & PimCommon::StorageServiceAbstract::CreateFolderCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("folder-new")), i18n("Create Folder..."), this, SLOT(slotCreateFolder()));
menu->addAction(QIcon::fromTheme(QStringLiteral("folder-new")), i18n("Create Folder..."), this, SLOT(slotCreateFolder()));
}
act = new QAction(menu);
......@@ -167,21 +167,21 @@ void StorageServiceTreeWidget::createMenuActions(QMenu *menu)
if (mCopyItem.moveItem) {
if (mCopyItem.type == FileType) {
if (mCapabilities & PimCommon::StorageServiceAbstract::MoveFileCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-paste")), i18n("Paste"), this, SLOT(slotMoveFile()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-paste")), i18n("Paste"), this, SLOT(slotMoveFile()));
}
} else if (mCopyItem.type == FolderType) {
if (mCapabilities & PimCommon::StorageServiceAbstract::MoveFolderCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-paste")), i18n("Paste"), this, SLOT(slotMoveFolder()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-paste")), i18n("Paste"), this, SLOT(slotMoveFolder()));
}
}
} else {
if (mCopyItem.type == FileType) {
if (mCapabilities & PimCommon::StorageServiceAbstract::CopyFileCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-paste")), i18n("Paste"), this, SLOT(slotPasteFile()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-paste")), i18n("Paste"), this, SLOT(slotPasteFile()));
}
} else if (mCopyItem.type == FolderType) {
if (mCapabilities & PimCommon::StorageServiceAbstract::CopyFolderCapability) {
menu->addAction(QIcon::fromTheme(QLatin1String("edit-paste")), i18n("Paste"), this, SLOT(slotPasteFolder()));
menu->addAction(QIcon::fromTheme(QStringLiteral("edit-paste")), i18n("Paste"), this, SLOT(slotPasteFolder()));
}
}
}
......@@ -192,7 +192,7 @@ void StorageServiceTreeWidget::createMenuActions(QMenu *menu)
createPropertiesAction(menu);
}
} else {
menu->addAction(QIcon::fromTheme(QLatin1String("view-refresh")), i18n("Refresh"), this, SLOT(refreshList()));
menu->addAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("Refresh"), this, SLOT(refreshList()));
}
}
......@@ -269,7 +269,7 @@ bool StorageServiceTreeWidget::checkName(const QString &name)
return false;
}
}
if (name == QLatin1String(".") || name == QLatin1String("..")) {
if (name == QStringLiteral(".") || name == QStringLiteral("..")) {
KMessageBox::error(this, i18n("You cannot name a folder or file . or .."), i18n("Create Folder"));
return false;
}
......@@ -376,7 +376,7 @@ void StorageServiceTreeWidget::slotDownloadFile()
bool StorageServiceTreeWidget::uploadFileToService()
{
const QString filename = QFileDialog::getOpenFileName(this, QString(), QString(), QLatin1String("*"));
const QString filename = QFileDialog::getOpenFileName(this, QString(), QString(), QStringLiteral("*"));
if (!filename.isEmpty()) {
const QRegExp disallowedSymbols = mStorageService->disallowedSymbols();
const qlonglong maximumLimit = mStorageService->maximumUploadFileSize();
......@@ -386,7 +386,7 @@ bool StorageServiceTreeWidget::uploadFileToService()
KMessageBox::error(this, i18n("File size (%1) is larger than limit (%2)", KFormat().formatByteSize(info.size(), 1), KFormat().formatByteSize(maximumLimit, 1)));
return false;
}
if (filename == QLatin1String(".") || filename == QLatin1String("..")) {
if (filename == QStringLiteral(".") || filename == QStringLiteral("..")) {
KMessageBox::error(this, i18n("You are trying to use unauthorized characters."));
return false;
}
......
......@@ -490,7 +490,7 @@ void TemplatesInsertCommand::slotMapped(int cmd)
switch (cmd) {
case TemplatesInsertCommand::CBlank:
emit insertCommand(QLatin1String("%BLANK"));
emit insertCommand(QStringLiteral("%BLANK"));
break;
case TemplatesInsertCommand::CQuote:
emit insertCommand(QStringLiteral("%QUOTE"));
......
Markdown is supported
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