Commit b570690e authored by Michal Humpula's avatar Michal Humpula

migrate from KAction to QAction (2/3)

REVIEW: 114508
parent 5ee044bd
......@@ -35,7 +35,6 @@
#include <kdialog.h>
#include <kpluginfactory.h>
#include <klocale.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <knotification.h>
#include <kparts/part.h>
......@@ -53,6 +52,7 @@
#include <QtWidgets/QSpinBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLayout>
#include <QtWidgets/QAction>
#include <kvbox.h>
#include <QtWidgets/QCheckBox>
......@@ -337,24 +337,24 @@ KateWordCompletionView::KateWordCompletionView( KTextEditor::View *view, KAction
KTextEditor::CodeCompletionInterface *cci = qobject_cast<KTextEditor::CodeCompletionInterface *>(view);
KAction *action;
QAction *action;
if (cci)
{
cci->registerCompletionModel( m_dWCompletionModel );
action = new KAction( i18n("Shell Completion"), this );
action = new QAction( i18n("Shell Completion"), this );
ac->addAction( "doccomplete_sh", action );
connect( action, SIGNAL(triggered()), this, SLOT(shellComplete()) );
}
action = new KAction( i18n("Reuse Word Above"), this );
action = new QAction( i18n("Reuse Word Above"), this );
ac->addAction( "doccomplete_bw", action );
action->setShortcut( Qt::CTRL+Qt::Key_8 );
connect( action, SIGNAL(triggered()), this, SLOT(completeBackwards()) );
action = new KAction( i18n("Reuse Word Below"), this );
action = new QAction( i18n("Reuse Word Below"), this );
ac->addAction( "doccomplete_fw", action );
action->setShortcut( Qt::CTRL+Qt::Key_9 );
connect( action, SIGNAL(triggered()), this, SLOT(completeForwards()) );
......
......@@ -32,7 +32,7 @@
//BEGIN KateScriptAction
KateScriptAction::KateScriptAction(const ScriptActionInfo& info, KateView* view)
: KAction(info.text(), view)
: QAction(info.text(), view)
, m_view(view)
, m_command(info.command())
, m_interactive(info.interactive())
......@@ -132,7 +132,7 @@ void KateScriptActionMenu::repopulate()
}
// create action + add to menu
KAction* a = new KateScriptAction(info, m_view);
QAction* a = new KateScriptAction(info, m_view);
m->addAction(a);
m_view->actionCollection()->addAction("tools_scripts_" + cmd, a);
m_actions.append(a);
......
......@@ -22,7 +22,8 @@
#include "katecommandlinescript.h"
#include <kactionmenu.h>
#include <kaction.h>
#include <QAction>
class KateView;
......@@ -30,7 +31,7 @@ class KateView;
* KateScriptAction is an action that executes a commandline-script
* if triggered. It is shown in Tools > Scripts.
*/
class KateScriptAction : public KAction
class KateScriptAction : public QAction
{
Q_OBJECT
......
......@@ -31,7 +31,6 @@
#include <QMenu>
#include <KActionCollection>
#include <KAction>
#include <KToolBar>
#include <KTextEditor/HighlightInterface>
......@@ -122,7 +121,7 @@ void KateSnippetGlobal::insertSnippet(Snippet* snippet)
void KateSnippetGlobal::insertSnippetFromActionData()
{
KAction* action = dynamic_cast<KAction*>(sender());
QAction* action = dynamic_cast<QAction*>(sender());
Q_ASSERT(action);
Snippet* snippet = action->data().value<Snippet*>();
Q_ASSERT(snippet);
......
......@@ -26,7 +26,6 @@
#include <QContextMenuEvent>
#include <KMenu>
#include <KMessageBox>
#include <KAction>
#include "snippet.h"
#include "katesnippetglobal.h"
......@@ -69,17 +68,17 @@ SnippetView::SnippetView(KateSnippetGlobal* plugin, QWidget* parent)
snippetTree->header()->hide();
m_addRepoAction = new KAction(KIcon("folder-new"), i18n("Add Repository"), this);
m_addRepoAction = new QAction(KIcon("folder-new"), i18n("Add Repository"), this);
connect(m_addRepoAction, SIGNAL(triggered()), this, SLOT(slotAddRepo()));
addAction(m_addRepoAction);
m_editRepoAction = new KAction(KIcon("folder-txt"), i18n("Edit Repository"), this);
m_editRepoAction = new QAction(KIcon("folder-txt"), i18n("Edit Repository"), this);
connect(m_editRepoAction, SIGNAL(triggered()), this, SLOT(slotEditRepo()));
addAction(m_editRepoAction);
m_removeRepoAction = new KAction(KIcon("edit-delete"), i18n("Remove Repository"), this);
m_removeRepoAction = new QAction(KIcon("edit-delete"), i18n("Remove Repository"), this);
connect(m_removeRepoAction, SIGNAL(triggered()), this, SLOT(slotRemoveRepo()));
addAction(m_removeRepoAction);
m_putNewStuffAction = new KAction(KIcon("get-hot-new-stuff"), i18n("Publish Repository"), this);
m_putNewStuffAction = new QAction(KIcon("get-hot-new-stuff"), i18n("Publish Repository"), this);
connect(m_putNewStuffAction, SIGNAL(triggered()), this, SLOT(slotSnippetToGHNS()));
addAction(m_putNewStuffAction);
......@@ -87,19 +86,19 @@ SnippetView::SnippetView(KateSnippetGlobal* plugin, QWidget* parent)
separator->setSeparator(true);
addAction(separator);
m_addSnippetAction = new KAction(KIcon("document-new"), i18n("Add Snippet"), this);
m_addSnippetAction = new QAction(KIcon("document-new"), i18n("Add Snippet"), this);
connect(m_addSnippetAction, SIGNAL(triggered()), this, SLOT(slotAddSnippet()));
addAction(m_addSnippetAction);
m_editSnippetAction = new KAction(KIcon("document-edit"), i18n("Edit Snippet"), this);
m_editSnippetAction = new QAction(KIcon("document-edit"), i18n("Edit Snippet"), this);
connect(m_editSnippetAction, SIGNAL(triggered()), this, SLOT(slotEditSnippet()));
addAction(m_editSnippetAction);
m_removeSnippetAction = new KAction(KIcon("document-close"), i18n("Remove Snippet"), this);
m_removeSnippetAction = new QAction(KIcon("document-close"), i18n("Remove Snippet"), this);
connect(m_removeSnippetAction, SIGNAL(triggered()), this, SLOT(slotRemoveSnippet()));
addAction(m_removeSnippetAction);
addAction(separator);
m_getNewStuffAction = new KAction(KIcon("get-hot-new-stuff"), i18n("Get New Snippets"), this);
m_getNewStuffAction = new QAction(KIcon("get-hot-new-stuff"), i18n("Get New Snippets"), this);
connect(m_getNewStuffAction, SIGNAL(triggered()), this, SLOT(slotGHNS()));
addAction(m_getNewStuffAction);
......
......@@ -29,7 +29,7 @@
class SnippetFilterProxyModel;
class QStandardItem;
class KateSnippetGlobal;
class KAction;
class QAction;
/**
* This class gets embedded into the right tool view by the KateSnippetGlobal.
......@@ -107,14 +107,14 @@ private:
KateSnippetGlobal* m_plugin;
SnippetFilterProxyModel* m_proxy;
KAction* m_addRepoAction;
KAction* m_removeRepoAction;
KAction* m_editRepoAction;
KAction* m_addSnippetAction;
KAction* m_removeSnippetAction;
KAction* m_editSnippetAction;
KAction* m_getNewStuffAction;
KAction* m_putNewStuffAction;
QAction *m_addRepoAction;
QAction *m_removeRepoAction;
QAction *m_editRepoAction;
QAction *m_addSnippetAction;
QAction *m_removeSnippetAction;
QAction *m_editSnippetAction;
QAction *m_getNewStuffAction;
QAction *m_putNewStuffAction;
};
#endif
......
......@@ -32,7 +32,6 @@
#include "kateview.h"
#include "spellcheck/spellcheck.h"
#include <kaction.h>
#include <kactioncollection.h>
#include <klocalizedstring.h>
#include <kicon.h>
......@@ -65,13 +64,13 @@ void KateSpellCheckDialog::createActions( KActionCollection* ac )
{
ac->addAction( KStandardAction::Spelling, this, SLOT(spellcheck()) );
KAction *a = new KAction( i18n("Spelling (from cursor)..."), this);
QAction *a = new QAction( i18n("Spelling (from cursor)..."), this);
ac->addAction("tools_spelling_from_cursor", a );
a->setIcon( KIcon( "tools-check-spelling" ) );
a->setWhatsThis(i18n("Check the document's spelling from the cursor and forward"));
connect( a, SIGNAL(triggered()), this, SLOT(spellcheckFromCursor()) );
m_spellcheckSelection = new KAction( i18n("Spellcheck Selection..."), this );
m_spellcheckSelection = new QAction( i18n("Spellcheck Selection..."), this );
ac->addAction("tools_spelling_selection", m_spellcheckSelection);
m_spellcheckSelection->setIcon( KIcon( "tools-check-spelling" ) );
m_spellcheckSelection->setWhatsThis(i18n("Check spelling of the selected text"));
......
......@@ -31,7 +31,8 @@
class KateView;
class KAction;
class QAction;
class KActionCollection;
class KProgressDialog;
namespace Sonnet {
......@@ -91,7 +92,7 @@ class KateSpellCheckDialog : public QObject
KTextEditor::Cursor locatePosition( int pos );
KateView *m_view;
KAction *m_spellcheckSelection;
QAction *m_spellcheckSelection;
Sonnet::Speller *m_speller;
Sonnet::BackgroundChecker *m_backgroundChecker;
......
......@@ -24,7 +24,6 @@
#include "kateview.h"
#include <klocale.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kguiitem.h>
#include <kicon.h>
......@@ -67,19 +66,19 @@ void KateBookmarks::createActions( KActionCollection* ac )
m_bookmarkToggle->setWhatsThis(i18n("If a line has no bookmark then add one, otherwise remove it."));
connect( m_bookmarkToggle, SIGNAL(triggered()), this, SLOT(toggleBookmark()) );
m_bookmarkClear = new KAction( i18n("Clear &All Bookmarks"), this );
m_bookmarkClear = new QAction( i18n("Clear &All Bookmarks"), this );
ac->addAction("bookmarks_clear", m_bookmarkClear);
m_bookmarkClear->setWhatsThis(i18n("Remove all bookmarks of the current document."));
connect( m_bookmarkClear, SIGNAL(triggered()), this, SLOT(clearBookmarks()) );
m_goNext = new KAction( i18n("Next Bookmark"), this);
m_goNext = new QAction( i18n("Next Bookmark"), this);
ac->addAction("bookmarks_next", m_goNext);
m_goNext->setIcon( KIcon( "go-down-search" ) );
m_goNext->setShortcut( Qt::ALT + Qt::Key_PageDown );
m_goNext->setWhatsThis(i18n("Go to the next bookmark."));
connect( m_goNext, SIGNAL(triggered()), this, SLOT(goNext()) );
m_goPrevious = new KAction( i18n("Previous Bookmark"), this);
m_goPrevious = new QAction( i18n("Previous Bookmark"), this);
ac->addAction("bookmarks_previous", m_goPrevious);
m_goPrevious->setIcon( KIcon( "go-up-search" ) );
m_goPrevious->setShortcut( Qt::ALT + Qt::Key_PageUp );
......
......@@ -26,10 +26,10 @@ class KateView;
namespace KTextEditor { class Mark; class View; }
class KAction;
class KToggleAction;
class KActionCollection;
class QMenu;
class QAction;
class KateBookmarks : public QObject
{
......@@ -65,9 +65,9 @@ class KateBookmarks : public QObject
private:
KateView* m_view;
KToggleAction* m_bookmarkToggle;
KAction* m_bookmarkClear;
KAction* m_goNext;
KAction* m_goPrevious;
QAction* m_bookmarkClear;
QAction* m_goNext;
QAction* m_goPrevious;
Sorting m_sorting;
QMenu* m_bookmarksMenu;
......
......@@ -74,7 +74,6 @@
#include <kglobal.h>
#include <kcharsets.h>
#include <kmessagebox.h>
#include <kaction.h>
#include <kstandardaction.h>
#include <kxmlguifactory.h>
#include <kxmlguiclient.h>
......
......@@ -65,9 +65,9 @@ class KateScriptConsole;
class KateMessageWidget;
class KToggleAction;
class KAction;
class KSelectAction;
class QAction;
class QVBoxLayout;
//
......
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