Commit 5593c252 authored by Artur Puzio's avatar Artur Puzio Committed by Emmanuel Pescosta

[CLAZY] Fixed all level 1 and level 2 warnings with small exceptions

REVIEW: 126771
parent 59811f84
......@@ -29,8 +29,8 @@
DBusInterface::DBusInterface() :
QObject()
{
QDBusConnection::sessionBus().registerService("org.freedesktop.FileManager1");
QDBusConnection::sessionBus().registerObject("/org/freedesktop/FileManager1", this,
QDBusConnection::sessionBus().registerService(QStringLiteral("org.freedesktop.FileManager1"));
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/freedesktop/FileManager1"), this,
QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
}
......@@ -41,7 +41,7 @@ void DBusInterface::ShowFolders(const QStringList& uriList, const QString& start
if (urls.isEmpty()) {
return;
}
KRun::run("dolphin %u", urls, nullptr);
KRun::run(QStringLiteral("dolphin %u"), urls, nullptr);
}
void DBusInterface::ShowItems(const QStringList& uriList, const QString& startUpId)
......@@ -51,7 +51,7 @@ void DBusInterface::ShowItems(const QStringList& uriList, const QString& startUp
if (urls.isEmpty()) {
return;
}
KRun::run("dolphin --select %u", urls, nullptr);
KRun::run(QStringLiteral("dolphin --select %u"), urls, nullptr);
}
void DBusInterface::ShowItemProperties(const QStringList& uriList, const QString& startUpId)
......
......@@ -139,14 +139,14 @@ void DolphinContextMenu::openTrashContextMenu()
{
Q_ASSERT(m_context & TrashContext);
QAction* emptyTrashAction = new QAction(QIcon::fromTheme("trash-empty"), i18nc("@action:inmenu", "Empty Trash"), this);
KConfig trashConfig("trashrc", KConfig::SimpleConfig);
QAction* emptyTrashAction = new QAction(QIcon::fromTheme(QStringLiteral("trash-empty")), i18nc("@action:inmenu", "Empty Trash"), this);
KConfig trashConfig(QStringLiteral("trashrc"), KConfig::SimpleConfig);
emptyTrashAction->setEnabled(!trashConfig.group("Status").readEntry("Empty", true));
addAction(emptyTrashAction);
addCustomActions();
QAction* propertiesAction = m_mainWindow->actionCollection()->action("properties");
QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties"));
addAction(propertiesAction);
addShowMenuBarAction();
......@@ -170,14 +170,15 @@ void DolphinContextMenu::openTrashItemContextMenu()
QAction* restoreAction = new QAction(i18nc("@action:inmenu", "Restore"), m_mainWindow);
addAction(restoreAction);
QAction* deleteAction = m_mainWindow->actionCollection()->action("delete");
QAction* deleteAction = m_mainWindow->actionCollection()->action(QStringLiteral("delete"));
addAction(deleteAction);
QAction* propertiesAction = m_mainWindow->actionCollection()->action("properties");
QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties"));
addAction(propertiesAction);
if (exec(m_pos) == restoreAction) {
QList<QUrl> selectedUrls;
selectedUrls.reserve(m_selectedItems.count());
foreach (const KFileItem &item, m_selectedItems) {
selectedUrls.append(item.url());
}
......@@ -212,36 +213,36 @@ void DolphinContextMenu::openItemContextMenu()
QMenu* menu = newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
menu->setIcon(QIcon::fromTheme("document-new"));
menu->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
addMenu(menu);
addSeparator();
// insert 'Open in new window' and 'Open in new tab' entries
addAction(m_mainWindow->actionCollection()->action("open_in_new_window"));
addAction(m_mainWindow->actionCollection()->action("open_in_new_tab"));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_window")));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_tab")));
// insert 'Add to Places' entry
if (!placeExists(m_fileInfo.url())) {
addToPlacesAction = addAction(QIcon::fromTheme("bookmark-new"),
addToPlacesAction = addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")),
i18nc("@action:inmenu Add selected folder to places",
"Add to Places"));
}
addSeparator();
} else if (m_baseUrl.scheme().contains("search") || m_baseUrl.scheme().contains("timeline")) {
openParentAction = new QAction(QIcon::fromTheme("document-open-folder"),
} else if (m_baseUrl.scheme().contains(QStringLiteral("search")) || m_baseUrl.scheme().contains(QStringLiteral("timeline"))) {
openParentAction = new QAction(QIcon::fromTheme(QStringLiteral("document-open-folder")),
i18nc("@action:inmenu",
"Open Path"),
this);
addAction(openParentAction);
openParentInNewWindowAction = new QAction(QIcon::fromTheme("window-new"),
openParentInNewWindowAction = new QAction(QIcon::fromTheme(QStringLiteral("window-new")),
i18nc("@action:inmenu",
"Open Path in New Window"),
this);
addAction(openParentInNewWindowAction);
openParentInNewTabAction = new QAction(QIcon::fromTheme("tab-new"),
openParentInNewTabAction = new QAction(QIcon::fromTheme(QStringLiteral("tab-new")),
i18nc("@action:inmenu",
"Open Path in New Tab"),
this);
......@@ -250,8 +251,8 @@ void DolphinContextMenu::openItemContextMenu()
addSeparator();
} else if (!DolphinView::openItemAsFolderUrl(m_fileInfo).isEmpty()) {
// insert 'Open in new window' and 'Open in new tab' entries
addAction(m_mainWindow->actionCollection()->action("open_in_new_window"));
addAction(m_mainWindow->actionCollection()->action("open_in_new_tab"));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_window")));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_tab")));
addSeparator();
}
......@@ -267,7 +268,7 @@ void DolphinContextMenu::openItemContextMenu()
if (selectionHasOnlyDirs) {
// insert 'Open in new tab' entry
addAction(m_mainWindow->actionCollection()->action("open_in_new_tabs"));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_tabs")));
addSeparator();
}
}
......@@ -293,7 +294,7 @@ void DolphinContextMenu::openItemContextMenu()
}
// insert 'Properties...' entry
QAction* propertiesAction = m_mainWindow->actionCollection()->action("properties");
QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties"));
addAction(propertiesAction);
QAction* activatedAction = exec(m_pos);
......@@ -330,13 +331,13 @@ void DolphinContextMenu::openViewportContextMenu()
// Insert 'New Window' and 'New Tab' entries. Don't use "open_in_new_window" and
// "open_in_new_tab" here, as the current selection should get ignored.
addAction(m_mainWindow->actionCollection()->action("new_window"));
addAction(m_mainWindow->actionCollection()->action("new_tab"));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("new_window")));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("new_tab")));
// Insert 'Add to Places' entry if exactly one item is selected
QAction* addToPlacesAction = 0;
if (!placeExists(m_mainWindow->activeViewContainer()->url())) {
addToPlacesAction = addAction(QIcon::fromTheme("bookmark-new"),
addToPlacesAction = addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")),
i18nc("@action:inmenu Add current folder to places", "Add to Places"));
}
......@@ -358,7 +359,7 @@ void DolphinContextMenu::openViewportContextMenu()
addCustomActions();
QAction* propertiesAction = m_mainWindow->actionCollection()->action("properties");
QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties"));
addAction(propertiesAction);
addShowMenuBarAction();
......@@ -388,7 +389,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
addSeparator();
// Insert 'Rename'
QAction* renameAction = collection->action("rename");
QAction* renameAction = collection->action(QStringLiteral("rename"));
addAction(renameAction);
// Insert 'Move to Trash' and/or 'Delete'
......@@ -401,10 +402,10 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
if (showDeleteAction && showMoveToTrashAction) {
delete m_removeAction;
m_removeAction = 0;
addAction(m_mainWindow->actionCollection()->action("move_to_trash"));
addAction(m_mainWindow->actionCollection()->action("delete"));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("move_to_trash")));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("delete")));
} else if (showDeleteAction && !showMoveToTrashAction) {
addAction(m_mainWindow->actionCollection()->action("delete"));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("delete")));
} else {
if (!m_removeAction) {
m_removeAction = new DolphinRemoveAction(this, m_mainWindow->actionCollection());
......@@ -443,7 +444,7 @@ QAction* DolphinContextMenu::createPasteAction()
const QMimeData *mimeData = QApplication::clipboard()->mimeData();
bool canPaste;
const QString text = KIO::pasteActionText(mimeData, &canPaste, m_fileInfo);
action = new QAction(QIcon::fromTheme("edit-paste"), text, this);
action = new QAction(QIcon::fromTheme(QStringLiteral("edit-paste")), text, this);
action->setEnabled(canPaste);
connect(action, &QAction::triggered, m_mainWindow, &DolphinMainWindow::pasteIntoFolder);
} else {
......@@ -474,7 +475,7 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions)
fileItemActions.setParentWidget(m_mainWindow);
// insert 'Open With...' action or sub menu
fileItemActions.addOpenWithActionsTo(this, "DesktopEntryName != 'dolphin'");
fileItemActions.addOpenWithActionsTo(this, QStringLiteral("DesktopEntryName != 'dolphin'"));
// insert 'Actions' sub menu
fileItemActions.addServiceActionsTo(this);
......@@ -491,15 +492,15 @@ void DolphinContextMenu::addFileItemPluginActions()
QString commonMimeType = props.mimeType();
if (commonMimeType.isEmpty()) {
commonMimeType = QLatin1String("application/octet-stream");
commonMimeType = QStringLiteral("application/octet-stream");
}
const KService::List pluginServices = KMimeTypeTrader::self()->query(commonMimeType, "KFileItemAction/Plugin", "exist Library");
const KService::List pluginServices = KMimeTypeTrader::self()->query(commonMimeType, QStringLiteral("KFileItemAction/Plugin"), QStringLiteral("exist Library"));
if (pluginServices.isEmpty()) {
return;
}
const KConfig config("kservicemenurc", KConfig::NoGlobals);
const KConfig config(QStringLiteral("kservicemenurc"), KConfig::NoGlobals);
const KConfigGroup showGroup = config.group("Show");
foreach (const KService::Ptr& service, pluginServices) {
......
......@@ -32,6 +32,8 @@ namespace {
// Empty titlebar for the dock widgets when "Lock Layout" has been activated.
class DolphinDockTitleBar : public QWidget
{
Q_OBJECT
public:
DolphinDockTitleBar(QWidget* parent = 0) : QWidget(parent) {}
virtual ~DolphinDockTitleBar() {}
......@@ -91,3 +93,4 @@ bool DolphinDockWidget::isLocked() const
return m_locked;
}
#include "dolphindockwidget.moc"
This diff is collapsed.
......@@ -26,7 +26,7 @@
#include <KIO/Job>
DolphinNewFileMenu::DolphinNewFileMenu(KActionCollection* collection, QObject* parent) :
KNewFileMenu(collection, "new_menu", parent)
KNewFileMenu(collection, QStringLiteral("new_menu"), parent)
{
DolphinNewFileMenuObserver::instance().attach(this);
}
......
......@@ -68,7 +68,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
m_extension = new DolphinPartBrowserExtension(this);
// make sure that other apps using this part find Dolphin's view-file-columns icons
KIconLoader::global()->addAppDir("dolphin");
KIconLoader::global()->addAppDir(QStringLiteral("dolphin"));
m_view = new DolphinView(QUrl(), parentWidget);
m_view->setTabsForFilesEnabled(true);
......@@ -81,7 +81,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
connect(m_view, &DolphinView::directoryLoadingProgress, this, &DolphinPart::updateProgress);
connect(m_view, &DolphinView::errorMessage, this, &DolphinPart::slotErrorMessage);
setXMLFile("dolphinpart.rc");
setXMLFile(QStringLiteral("dolphinpart.rc"));
connect(m_view, &DolphinView::infoMessage,
this, &DolphinPart::slotMessage);
......@@ -167,26 +167,26 @@ void DolphinPart::createActions()
connect(m_newFileMenu->menu(), &QMenu::aboutToShow,
this, &DolphinPart::updateNewMenu);
QAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" );
QAction *editMimeTypeAction = actionCollection()->addAction( QStringLiteral("editMimeType") );
editMimeTypeAction->setText( i18nc("@action:inmenu Edit", "&Edit File Type..." ) );
connect(editMimeTypeAction, &QAction::triggered, this, &DolphinPart::slotEditMimeType);
QAction* selectItemsMatching = actionCollection()->addAction("select_items_matching");
QAction* selectItemsMatching = actionCollection()->addAction(QStringLiteral("select_items_matching"));
selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching..."));
actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL | Qt::Key_S);
connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern);
QAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching");
QAction* unselectItemsMatching = actionCollection()->addAction(QStringLiteral("unselect_items_matching"));
unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching..."));
connect(unselectItemsMatching, &QAction::triggered, this, &DolphinPart::slotUnselectItemsMatchingPattern);
actionCollection()->addAction(KStandardAction::SelectAll, "select_all", m_view, SLOT(selectAll()));
actionCollection()->addAction(KStandardAction::SelectAll, QStringLiteral("select_all"), m_view, SLOT(selectAll()));
QAction* unselectAll = actionCollection()->addAction("unselect_all");
QAction* unselectAll = actionCollection()->addAction(QStringLiteral("unselect_all"));
unselectAll->setText(i18nc("@action:inmenu Edit", "Unselect All"));
connect(unselectAll, &QAction::triggered, m_view, &DolphinView::clearSelection);
QAction* invertSelection = actionCollection()->addAction("invert_selection");
QAction* invertSelection = actionCollection()->addAction(QStringLiteral("invert_selection"));
invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL | Qt::SHIFT | Qt::Key_A);
connect(invertSelection, &QAction::triggered, m_view, &DolphinView::invertSelection);
......@@ -216,15 +216,15 @@ void DolphinPart::createActions()
goActionGroup);
// Tools menu
m_findFileAction = actionCollection()->addAction("find_file");
m_findFileAction = actionCollection()->addAction(QStringLiteral("find_file"));
m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File..."));
actionCollection()->setDefaultShortcut(m_findFileAction, Qt::CTRL | Qt::Key_F);
m_findFileAction->setIcon(QIcon::fromTheme("edit-find"));
m_findFileAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-find")));
connect(m_findFileAction, &QAction::triggered, this, &DolphinPart::slotFindFile);
if (KAuthorized::authorizeKAction("shell_access")) {
m_openTerminalAction = actionCollection()->addAction("open_terminal");
m_openTerminalAction->setIcon(QIcon::fromTheme("utilities-terminal"));
if (KAuthorized::authorizeKAction(QStringLiteral("shell_access"))) {
m_openTerminalAction = actionCollection()->addAction(QStringLiteral("open_terminal"));
m_openTerminalAction->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal")));
m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal"));
connect(m_openTerminalAction, &QAction::triggered, this, &DolphinPart::slotOpenTerminal);
actionCollection()->setDefaultShortcut(m_openTerminalAction, Qt::Key_F4);
......@@ -252,22 +252,22 @@ void DolphinPart::slotSelectionChanged(const KFileItemList& selection)
{
const bool hasSelection = !selection.isEmpty();
QAction* renameAction = actionCollection()->action("rename");
QAction* moveToTrashAction = actionCollection()->action("move_to_trash");
QAction* deleteAction = actionCollection()->action("delete");
QAction* editMimeTypeAction = actionCollection()->action("editMimeType");
QAction* propertiesAction = actionCollection()->action("properties");
QAction* deleteWithTrashShortcut = actionCollection()->action("delete_shortcut"); // see DolphinViewActionHandler
QAction* renameAction = actionCollection()->action(QStringLiteral("rename"));
QAction* moveToTrashAction = actionCollection()->action(QStringLiteral("move_to_trash"));
QAction* deleteAction = actionCollection()->action(QStringLiteral("delete"));
QAction* editMimeTypeAction = actionCollection()->action(QStringLiteral("editMimeType"));
QAction* propertiesAction = actionCollection()->action(QStringLiteral("properties"));
QAction* deleteWithTrashShortcut = actionCollection()->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler
if (!hasSelection) {
stateChanged("has_no_selection");
stateChanged(QStringLiteral("has_no_selection"));
emit m_extension->enableAction("cut", false);
emit m_extension->enableAction("copy", false);
deleteWithTrashShortcut->setEnabled(false);
editMimeTypeAction->setEnabled(false);
} else {
stateChanged("has_selection");
stateChanged(QStringLiteral("has_selection"));
// TODO share this code with DolphinMainWindow::updateEditActions (and the desktop code)
// in libkonq
......@@ -294,7 +294,7 @@ void DolphinPart::updatePasteAction()
KAboutData* DolphinPart::createAboutData()
{
return new KAboutData("dolphinpart", i18nc("@title", "Dolphin Part"), "0.1");
return new KAboutData(QStringLiteral("dolphinpart"), i18nc("@title", "Dolphin Part"), QStringLiteral("0.1"));
}
bool DolphinPart::openUrl(const QUrl &url)
......@@ -351,7 +351,7 @@ void DolphinPart::slotRequestItemInfo(const KFileItem& item)
updateStatusBar();
} else {
const QString escapedText = Qt::convertFromPlainText(item.getStatusBarInfo());
ReadOnlyPart::setStatusBarText(QString("<qt>%1</qt>").arg(escapedText));
ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
}
}
......@@ -432,10 +432,10 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
if (showDeleteAction && showMoveToTrashAction) {
delete m_removeAction;
m_removeAction = 0;
editActions.append(actionCollection()->action("move_to_trash"));
editActions.append(actionCollection()->action("delete"));
editActions.append(actionCollection()->action(QStringLiteral("move_to_trash")));
editActions.append(actionCollection()->action(QStringLiteral("delete")));
} else if (showDeleteAction && !showMoveToTrashAction) {
editActions.append(actionCollection()->action("delete"));
editActions.append(actionCollection()->action(QStringLiteral("delete")));
} else {
if (!m_removeAction)
m_removeAction = new DolphinRemoveAction(this, actionCollection());
......@@ -447,7 +447,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
}
if (supportsMoving) {
editActions.append(actionCollection()->action("rename"));
editActions.append(actionCollection()->action(QStringLiteral("rename")));
}
// Normally KonqPopupMenu only shows the "Create new" submenu in the current view
......@@ -458,7 +458,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
}
actionGroups.insert("editactions", editActions);
actionGroups.insert(QStringLiteral("editactions"), editActions);
emit m_extension->popupMenu(pos,
items,
......@@ -504,7 +504,7 @@ void DolphinPart::slotUnselectItemsMatchingPattern()
void DolphinPart::openSelectionDialog(const QString& title, const QString& text, bool selectItems)
{
bool okClicked;
const QString pattern = QInputDialog::getText(m_view, title, text, QLineEdit::Normal, "*", &okClicked);
const QString pattern = QInputDialog::getText(m_view, title, text, QLineEdit::Normal, QStringLiteral("*"), &okClicked);
if (okClicked && !pattern.isEmpty()) {
QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard);
......@@ -555,7 +555,7 @@ void DolphinPart::slotOpenTerminal()
void DolphinPart::slotFindFile()
{
KRun::run("kfind", {url()}, widget());
KRun::run(QStringLiteral("kfind"), {url()}, widget());
}
void DolphinPart::updateNewMenu()
......@@ -570,7 +570,7 @@ void DolphinPart::updateNewMenu()
void DolphinPart::updateStatusBar()
{
const QString escapedText = Qt::convertFromPlainText(m_view->statusBarText());
emit ReadOnlyPart::setStatusBarText(QString("<qt>%1</qt>").arg(escapedText));
emit ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
}
void DolphinPart::updateProgress(int percent)
......
......@@ -98,7 +98,7 @@ protected:
/**
* We reimplement openUrl so no need to implement openFile.
*/
virtual bool openFile() { return true; }
virtual bool openFile() override { return true; }
Q_SIGNALS:
/**
......
......@@ -25,19 +25,19 @@
#include <QMenu>
DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
KActionMenu(QIcon::fromTheme("edit-undo"), i18n("Recently Closed Tabs"), parent)
KActionMenu(QIcon::fromTheme(QStringLiteral("edit-undo")), i18n("Recently Closed Tabs"), parent)
{
setDelayed(false);
setEnabled(false);
m_clearListAction = new QAction(i18n("Empty Recently Closed Tabs"), this);
m_clearListAction->setIcon(QIcon::fromTheme("edit-clear-list"));
m_clearListAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-clear-list")));
addAction(m_clearListAction);
addSeparator();
connect(menu(), SIGNAL(triggered(QAction*)),
this, SLOT(handleAction(QAction*)));
connect(menu(), &QMenu::triggered,
this, &DolphinRecentTabsMenu::handleAction);
}
void DolphinRecentTabsMenu::rememberClosedTab(const QUrl& url, const QByteArray& state)
......@@ -83,7 +83,7 @@ void DolphinRecentTabsMenu::handleAction(QAction* action)
}
emit closedTabsCountChanged(0);
} else {
const QByteArray state = action->data().value<QByteArray>();
const QByteArray state = action->data().toByteArray();
removeAction(action);
delete action;
action = 0;
......
......@@ -46,10 +46,10 @@ void DolphinRemoveAction::update()
// This is only done until the original action has been shown at least once. To
// bypass this issue, the text and &-shortcut is applied manually.
if (qApp->keyboardModifiers() & Qt::ShiftModifier) {
m_action = m_collection ? m_collection->action("delete") : 0;
m_action = m_collection ? m_collection->action(QStringLiteral("delete")) : 0;
setText(i18nc("@action:inmenu", "&Delete"));
} else {
m_action = m_collection ? m_collection->action("move_to_trash") : 0;
m_action = m_collection ? m_collection->action(QStringLiteral("move_to_trash")) : 0;
setText(i18nc("@action:inmenu", "&Move to Trash"));
}
......
......@@ -39,8 +39,8 @@ DolphinTabBar::DolphinTabBar(QWidget* parent) :
m_autoActivationTimer = new QTimer(this);
m_autoActivationTimer->setSingleShot(true);
m_autoActivationTimer->setInterval(800);
connect(m_autoActivationTimer, SIGNAL(timeout()),
this, SLOT(slotAutoActivationTimeout()));
connect(m_autoActivationTimer, &QTimer::timeout,
this, &DolphinTabBar::slotAutoActivationTimeout);
}
void DolphinTabBar::dragEnterEvent(QDragEnterEvent* event)
......@@ -125,10 +125,10 @@ void DolphinTabBar::contextMenuEvent(QContextMenuEvent* event)
// Tab context menu
QMenu menu(this);
QAction* newTabAction = menu.addAction(QIcon::fromTheme("tab-new"), i18nc("@action:inmenu", "New Tab"));
QAction* detachTabAction = menu.addAction(QIcon::fromTheme("tab-detach"), i18nc("@action:inmenu", "Detach Tab"));
QAction* closeOtherTabsAction = menu.addAction(QIcon::fromTheme("tab-close-other"), i18nc("@action:inmenu", "Close Other Tabs"));
QAction* closeTabAction = menu.addAction(QIcon::fromTheme("tab-close"), i18nc("@action:inmenu", "Close Tab"));
QAction* newTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@action:inmenu", "New Tab"));
QAction* detachTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-detach")), i18nc("@action:inmenu", "Detach Tab"));
QAction* closeOtherTabsAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-close-other")), i18nc("@action:inmenu", "Close Other Tabs"));
QAction* closeTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-close")), i18nc("@action:inmenu", "Close Tab"));
QAction* selectedAction = menu.exec(event->globalPos());
if (selectedAction == newTabAction) {
......
......@@ -40,10 +40,10 @@ DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl,
// Create a new primary view
m_primaryViewContainer = createViewContainer(primaryUrl);
connect(m_primaryViewContainer->view(), SIGNAL(urlChanged(QUrl)),
this, SIGNAL(activeViewUrlChanged(QUrl)));
connect(m_primaryViewContainer->view(), SIGNAL(redirection(QUrl,QUrl)),
this, SLOT(slotViewUrlRedirection(QUrl,QUrl)));
connect(m_primaryViewContainer->view(), &DolphinView::urlChanged,
this, &DolphinTabPage::activeViewUrlChanged);
connect(m_primaryViewContainer->view(), &DolphinView::redirection,
this, &DolphinTabPage::slotViewUrlRedirection);
m_splitter->addWidget(m_primaryViewContainer);
m_primaryViewContainer->show();
......@@ -302,14 +302,14 @@ void DolphinTabPage::slotViewActivated()
const DolphinView* newActiveView = activeViewContainer()->view();
if (newActiveView != oldActiveView) {
disconnect(oldActiveView, SIGNAL(urlChanged(QUrl)),
this, SIGNAL(activeViewUrlChanged(QUrl)));
disconnect(oldActiveView, SIGNAL(redirection(QUrl,QUrl)),
this, SLOT(slotViewUrlRedirection(QUrl,QUrl)));
connect(newActiveView, SIGNAL(urlChanged(QUrl)),
this, SIGNAL(activeViewUrlChanged(QUrl)));
connect(newActiveView, SIGNAL(redirection(QUrl,QUrl)),
this, SLOT(slotViewUrlRedirection(QUrl,QUrl)));
disconnect(oldActiveView, &DolphinView::urlChanged,
this, &DolphinTabPage::activeViewUrlChanged);
disconnect(oldActiveView, &DolphinView::redirection,
this, &DolphinTabPage::slotViewUrlRedirection);
connect(newActiveView, &DolphinView::urlChanged,
this, &DolphinTabPage::activeViewUrlChanged);
connect(newActiveView, &DolphinView::redirection,
this, &DolphinTabPage::slotViewUrlRedirection);
}
emit activeViewUrlChanged(activeViewContainer()->url());
......@@ -329,8 +329,8 @@ DolphinViewContainer* DolphinTabPage::createViewContainer(const QUrl& url) const
container->setActive(false);
const DolphinView* view = container->view();
connect(view, SIGNAL(activated()),
this, SLOT(slotViewActivated()));
connect(view, &DolphinView::activated,
this, &DolphinTabPage::slotViewActivated);
return container;
}
......@@ -24,6 +24,7 @@
#include "dolphinviewcontainer.h"
#include <QApplication>
#include <QDropEvent>
#include <KConfigGroup>
#include <KShell>
#include <kio/global.h>
......@@ -33,18 +34,18 @@ DolphinTabWidget::DolphinTabWidget(QWidget* parent) :
QTabWidget(parent),
m_placesSelectorVisible(true)
{
connect(this, SIGNAL(tabCloseRequested(int)),
this, SLOT(closeTab(int)));
connect(this, SIGNAL(currentChanged(int)),
this, SLOT(currentTabChanged(int)));
connect(this, &DolphinTabWidget::tabCloseRequested,
this, static_cast<void (DolphinTabWidget::*)(int)>(&DolphinTabWidget::closeTab));
connect(this