[Uml-devel] branches/work/kaction-cleanup-branch/kdesdk
Kevin Ottens
ervin at kde.org
Mon Dec 4 14:50:58 UTC 2006
SVN commit 610570 by ervin:
Port to the new KAction-less API.
M +1 -1 kbabel/catalogmanager/catalogmanager.cpp
M +35 -35 kbabel/kbabel/kbabel.cpp
M +2 -2 kcachegrind/kcachegrind/toplevel.cpp
M +54 -54 umbrello/umbrello/uml.h
--- branches/work/kaction-cleanup-branch/kdesdk/kbabel/catalogmanager/catalogmanager.cpp #610569:610570
@@ -674,7 +674,7 @@
{
QMap<QString,uint>::Iterator it;
for (it = actionMap.begin( ); it != actionMap.end( ); ++it) {
- KAction *action = actionCollection()->action( it.key()/*.toLatin1()*/ );
+ QAction *action = actionCollection()->action( it.key()/*.toLatin1()*/ );
if ( action ) action->setEnabled( ( actionValue & it.value() ) == it.value() );
}
}
--- branches/work/kaction-cleanup-branch/kdesdk/kbabel/kbabel/kbabel.cpp #610569:610570
@@ -138,14 +138,14 @@
: KMainWindow (), m_charselectorview(0)
{
_project = ProjectManager::open(projectFile);
-
+
if ( !_project )
{
KMessageBox::error( this, i18n("Cannot open project file\n%1", projectFile)
, i18n("Project File Error"));
_project = ProjectManager::open(KBABEL_DEFAULTPROJECT);
}
-
+
KBCatalog* catalog=new KBCatalog(projectFile);
init(catalog);
}
@@ -161,7 +161,7 @@
, i18n("Project File Error"));
_project = ProjectManager::open(KBABEL_DEFAULTPROJECT);
}
-
+
init(catalog);
}
@@ -305,7 +305,7 @@
bmHandler = new KBabelBookmarkHandler((Q3PopupMenu*)factory()->container("bookmark", this));
// the earlier created KAction for "clear_bookmarks" is now reconnected
- KAction* action = actionCollection()->action("clear_bookmarks");
+ QAction* action = actionCollection()->action("clear_bookmarks");
if (action) {
action->disconnect(SIGNAL(activated()));
connect(action, SIGNAL(activated()),
@@ -412,14 +412,14 @@
void KBabelMW::setupActions()
{
- KAction* action;
+ QAction* action;
// the file menu
action = KStdAction::open(this, SLOT(fileOpen()), actionCollection());
a_recent = KStdAction::openRecent(this, SLOT(openRecent(const KUrl&)), actionCollection());
a_recent->setMaxItems(MAX_RECENT);
-
+
action = KStdAction::revert(m_view,SLOT(revertToSaved()),actionCollection());
action = KStdAction::save(this, SLOT(fileSave()), actionCollection());
action = KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
@@ -545,7 +545,7 @@
connect( actionNext, SIGNAL( triggered() ), m_view , SLOT( gotoNext() ) );
action = KStdAction::goTo(m_view, SLOT(gotoEntry()), actionCollection());
- action->setShortcut( KStdAccel::gotoLine());
+ action->setShortcuts( KStdAccel::gotoLine().toList());
action = KStdAction::firstPage(m_view, SLOT(gotoFirst()),actionCollection());
action->setText(i18n("&First Entry"));
action->setShortcut(QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_Home));
@@ -811,7 +811,7 @@
KActionMenu* m_menu = new KActionMenu(i18n("&Validation"), actionCollection(), "dynamic_validation_tools");
- KAction* ac = new KAction( i18n("Perform &All Checks"), actionCollection(), "check_all" );
+ QAction* ac = new KAction( i18n("Perform &All Checks"), actionCollection(), "check_all" );
ac->setShortcut( QKeySequence( Qt::CTRL+Qt::Key_E ) );
ac->setEnabled( false );
connect( ac, SIGNAL( triggered() ), m_view, SLOT( checkAll() ) );
@@ -1050,9 +1050,9 @@
KBabelView *view = KBabelView::viewForURL(url,QString::null);
if(view)
{
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_UNIX
KWin::activateWindow(view->topLevelWidget()->winId());
-#endif
+#endif
return;
}
@@ -1072,7 +1072,7 @@
if(view)
{
kDebug(KBABEL) << "there is a such view" << endl;
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_UNIX
KWin::activateWindow(view->topLevelWidget()->winId());
#endif
return;
@@ -1138,7 +1138,7 @@
else
{
// disable save
- KAction* saveAction=(KAction*)actionCollection()->action( KStdAction::name( KStdAction::Save) );
+ QAction* saveAction=actionCollection()->action( KStdAction::name( KStdAction::Save) );
saveAction->setEnabled(false);
m_view->saveFile();
@@ -1281,9 +1281,9 @@
}
_prefDialog->raise();
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_UNIX
KWin::activateWindow(_prefDialog->winId());
-#endif
+#endif
}
void KBabelMW::setLedColor(const QColor& color)
@@ -1347,8 +1347,8 @@
void KBabelMW::firstEntryDisplayed(bool firstEntry, bool firstForm)
{
- KAction* firstAction=(KAction*)actionCollection()->action(KStdAction::stdName(KStdAction::FirstPage));
- KAction* prevAction=(KAction*)actionCollection()->action("go_prev_entry");
+ QAction* firstAction=actionCollection()->action(KStdAction::stdName(KStdAction::FirstPage));
+ QAction* prevAction=actionCollection()->action("go_prev_entry");
firstAction->setEnabled(!firstEntry);
prevAction->setEnabled(!(firstEntry && firstForm));
@@ -1357,8 +1357,8 @@
void KBabelMW::lastEntryDisplayed(bool lastEntry, bool lastForm)
{
- KAction* lastAction=(KAction*)actionCollection()->action(KStdAction::stdName(KStdAction::LastPage));
- KAction* nextAction=(KAction*)actionCollection()->action("go_next_entry");
+ QAction* lastAction=actionCollection()->action(KStdAction::stdName(KStdAction::LastPage));
+ QAction* nextAction=actionCollection()->action("go_next_entry");
lastAction->setEnabled(!lastEntry);
nextAction->setEnabled(!(lastEntry && lastForm));
@@ -1389,7 +1389,7 @@
return;
// do not allow fuzzy toggle for untranslated
- KAction *action=actionCollection()->action("edit_toggle_fuzzy");
+ QAction *action=actionCollection()->action("edit_toggle_fuzzy");
if(action)
action->setEnabled(!flag);
@@ -1511,26 +1511,26 @@
void KBabelMW::hasErrorAfterwards(bool flag)
{
- KAction* action=actionCollection()->action("go_next_error");
+ QAction* action=actionCollection()->action("go_next_error");
action->setEnabled(flag);
}
void KBabelMW::hasErrorInFront(bool flag)
{
- KAction* action=actionCollection()->action("go_prev_error");
+ QAction* action=actionCollection()->action("go_prev_error");
action->setEnabled(flag);
}
void KBabelMW::enableBackHistory(bool on)
{
- KAction* action=actionCollection()->action("go_back_history");
+ QAction* action=actionCollection()->action("go_back_history");
action->setEnabled(on);
}
void KBabelMW::enableForwardHistory(bool on)
{
- KAction* action=actionCollection()->action("go_forward_history");
+ QAction* action=actionCollection()->action("go_forward_history");
action->setEnabled(on);
}
@@ -1586,7 +1586,7 @@
// display the text on the caption
setCaption(m_view->catalog()->package(),on);
- KAction *action=actionCollection()->action(
+ QAction *action=actionCollection()->action(
KStdAction::stdName(KStdAction::Save));
action->setEnabled(on);
@@ -1608,19 +1608,19 @@
void KBabelMW::enableUndo(bool on)
{
- KAction* action=actionCollection()->action(KStdAction::stdName(KStdAction::Undo));
+ QAction* action=actionCollection()->action(KStdAction::stdName(KStdAction::Undo));
action->setEnabled(on);
}
void KBabelMW::enableRedo(bool on)
{
- KAction* action=actionCollection()->action(KStdAction::stdName(KStdAction::Redo));
+ QAction* action=actionCollection()->action(KStdAction::stdName(KStdAction::Redo));
action->setEnabled(on);
}
void KBabelMW::enableStop(bool flag)
{
- KAction* action=(KAction*)actionCollection()->action("stop_search");
+ QAction* action=actionCollection()->action("stop_search");
action->setEnabled(flag);
}
@@ -1783,7 +1783,7 @@
{
return;
}
-
+
projectOpen (file);
}
@@ -1817,7 +1817,7 @@
m_view->useProject(p);
changeProjectActions(file);
}
- else
+ else
{
KMessageBox::error( this, i18n("Cannot open project file\n%1", file)
, i18n("Project File Error"));
@@ -1838,16 +1838,16 @@
{
bool def = project == KBABEL_DEFAULTPROJECT;
- KAction* saveAction=(KAction*)actionCollection()->action( "project_close" );
+ QAction* saveAction=actionCollection()->action( "project_close" );
saveAction->setEnabled( ! def );
-
+
if (!def)
{
addToRecentProjects(project);
}
-
+
// if there is a project dialog, delete it (we have a different project now
- if (_projectDialog)
+ if (_projectDialog)
{
delete _projectDialog;
_projectDialog = NULL;
@@ -1879,9 +1879,9 @@
}
_projectDialog->raise();
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_UNIX
KWin::activateWindow(_projectDialog->winId());
-#endif
+#endif
}
void KBabelMW::addToRecentProjects(const KUrl& url)
--- branches/work/kaction-cleanup-branch/kdesdk/kcachegrind/kcachegrind/toplevel.cpp #610569:610570
@@ -1855,7 +1855,7 @@
void TopLevel::updateLayoutActions()
{
- KAction* ka;
+ QAction* ka;
ka = actionCollection()->action("layout_next");
if (ka) ka->setEnabled(_layoutCount>1);
@@ -1943,7 +1943,7 @@
delete toolBar();
#ifdef __GNUC__
#warning port to Qt4
-#endif
+#endif
#if 0
KConfigGroup dockConfig(KGlobal::config(), QByteArray("Docks"));
QString str;
--- branches/work/kaction-cleanup-branch/kdesdk/umbrello/umbrello/uml.h #610569:610570
@@ -270,7 +270,7 @@
UMLView* getCurrentView();
/**
- * Sets the default mime type for all diagrams that are exported as
+ * Sets the default mime type for all diagrams that are exported as
* images.
*
* @param mimeType The MIME type to set as the default.
@@ -278,7 +278,7 @@
void setImageMimeType(QString const & mimeType){m_imageMimeType=mimeType;};
/**
- * Gets the default mime type for all diagrams that are exported as
+ * Gets the default mime type for all diagrams that are exported as
* images.
*
* @return The default MIME type for images.
@@ -488,23 +488,23 @@
* aborts.
*/
void slotFileQuit();
-
+
/**
- * Exports the current model to docbook in a subdir of the
+ * Exports the current model to docbook in a subdir of the
* current model directory named from the model name.
- * @todo Let the user chose the destination directory and
+ * @todo Let the user chose the destination directory and
* name, using network transparency.
*/
void slotFileExportDocbook();
-
+
/**
- * Exports the current model to XHTML in a subdir of the
+ * Exports the current model to XHTML in a subdir of the
* current model directory named from the model name.
- * @todo Let the user chose the destination directory and
+ * @todo Let the user chose the destination directory and
* name, using network transparency.
*/
void slotFileExportXhtml();
-
+
/**
* Put the marked text/object into the clipboard and remove
* it from the document.
@@ -534,7 +534,7 @@
*/
void slotViewStatusBar();
// #endif
-
+
/**
* Changes the statusbar contents for the standard label
* permanently, used to indicate current actions.
@@ -620,7 +620,7 @@
/**
* Set the language for which code will be generated.
*
- * @param menuID the ID of the langSelect menu item for
+ * @param menuID the ID of the langSelect menu item for
* the relevant language.
*/
void setActiveLanguage(int menuID);
@@ -773,7 +773,7 @@
* @param name The name of the menu to search for (name, not text)
*/
QMenu* findMenu(QMenu* menu, const QString &name);
-
+
/// @todo This is an ugly _HACK_ to allow to compile umbrello.
/// All the menu stuff should be ported to KDE4 (using actions)
QMenu* findMenu(KMenuBar* menu, const QString &name);
@@ -858,7 +858,7 @@
void initClip();
/**
- * Initialize code generators at startup.
+ * Initialize code generators at startup.
* Why is this important? Because IF we don't do this, then changes
* to the UML may not be synced with the saved code generation params
* for those languages which arent currently active.
@@ -914,60 +914,60 @@
RefactoringAssistant* m_refactoringAssist;
//KAction pointers to enable/disable actions
- KAction* fileNew;
- KAction* fileOpen;
+ QAction* fileNew;
+ QAction* fileOpen;
KRecentFilesAction* fileOpenRecent;
- KAction* fileSave;
- KAction* fileSaveAs;
- KAction* fileClose;
- KAction* filePrint;
- KAction* fileQuit;
- KAction* fileExportDocbook;
- KAction* fileExportXhtml;
+ QAction* fileSave;
+ QAction* fileSaveAs;
+ QAction* fileClose;
+ QAction* filePrint;
+ QAction* fileQuit;
+ QAction* fileExportDocbook;
+ QAction* fileExportXhtml;
- KAction* editCut;
- KAction* editCopy;
- KAction* editPaste;
- KAction* editUndo;
- KAction* editRedo;
- KAction* selectAll;
- KAction* preferences;
+ QAction* editCut;
+ QAction* editCopy;
+ QAction* editPaste;
+ QAction* editUndo;
+ QAction* editRedo;
+ QAction* selectAll;
+ QAction* preferences;
KActionMenu* newDiagram;
- KAction* classDiagram;
- KAction* sequenceDiagram;
- KAction* collaborationDiagram;
- KAction* useCaseDiagram;
- KAction* stateDiagram;
- KAction* activityDiagram;
- KAction* componentDiagram;
- KAction* deploymentDiagram;
- KAction* entityRelationshipDiagram;
- KAction* viewClearDiagram;
+ QAction* classDiagram;
+ QAction* sequenceDiagram;
+ QAction* collaborationDiagram;
+ QAction* useCaseDiagram;
+ QAction* stateDiagram;
+ QAction* activityDiagram;
+ QAction* componentDiagram;
+ QAction* deploymentDiagram;
+ QAction* entityRelationshipDiagram;
+ QAction* viewClearDiagram;
KToggleAction* viewSnapToGrid;
KToggleAction* viewShowGrid;
- KAction* viewExportImage;
- KAction* viewExportImageAll;
- KAction* viewProperties;
+ QAction* viewExportImage;
+ QAction* viewExportImageAll;
+ QAction* viewProperties;
- KAction* zoom100Action;
+ QAction* zoom100Action;
KPlayerPopupSliderAction* zoomAction;
- KAction* genAll;
- KAction* genWizard;
- KAction* importClasses;
- KAction* classWizard;
- KAction* deleteSelectedWidget;
- KAction* deleteDiagram;
+ QAction* genAll;
+ QAction* genWizard;
+ QAction* importClasses;
+ QAction* classWizard;
+ QAction* deleteSelectedWidget;
+ QAction* deleteDiagram;
#ifdef HAVE_DOT
- KAction* autolayout;
+ QAction* autolayout;
#endif
- KAction* changeTabLeft;
- KAction* changeTabRight;
- KAction* moveTabLeft;
- KAction* moveTabRight;
+ QAction* changeTabLeft;
+ QAction* changeTabRight;
+ QAction* moveTabLeft;
+ QAction* moveTabRight;
QToolButton* m_newSessionButton;
KMenu* m_diagramMenu;
QToolButton* m_closeDiagramButton;
More information about the umbrello-devel
mailing list