projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stylesheetify the marker line color
[quassel.git]
/
src
/
uisupport
/
actioncollection.cpp
diff --git
a/src/uisupport/actioncollection.cpp
b/src/uisupport/actioncollection.cpp
index
a20d918
..
b752cfb
100644
(file)
--- a/
src/uisupport/actioncollection.cpp
+++ b/
src/uisupport/actioncollection.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-0
8
by the Quassel Project *
+ * Copyright (C) 2005-0
9
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-20,7
+20,10
@@
* Parts of this implementation are based on KDE's KActionCollection. *
***************************************************************************/
* Parts of this implementation are based on KDE's KActionCollection. *
***************************************************************************/
+#ifndef HAVE_KDE
+
#include <QAction>
#include <QAction>
+#include <QDebug>
#include "actioncollection.h"
#include "actioncollection.h"
@@
-49,7
+52,8
@@
QList<QAction *> ActionCollection::actions() const {
}
Action *ActionCollection::addAction(const QString &name, Action *action) {
}
Action *ActionCollection::addAction(const QString &name, Action *action) {
- QAction *act = addAction(name, action);
+ QAction *act = addAction(name, static_cast<QAction *>(action));
+ Q_UNUSED(act);
Q_ASSERT(act == action);
return action;
}
Q_ASSERT(act == action);
return action;
}
@@
-73,7
+77,7
@@
QAction *ActionCollection::addAction(const QString &name, QAction *action) {
else
action->setObjectName(indexName);
if(indexName.isEmpty())
else
action->setObjectName(indexName);
if(indexName.isEmpty())
- indexName =
QString("unnamed-%1").arg((int)action, 16
);
+ indexName =
indexName.sprintf("unnamed-%p", (void *)action
);
// do we already have this action?
if(_actionByName.value(indexName, 0) == action)
// do we already have this action?
if(_actionByName.value(indexName, 0) == action)
@@
-206,6
+210,10
@@
void ActionCollection::clearAssociatedWidgets() {
_associatedWidgets.clear();
}
_associatedWidgets.clear();
}
+void ActionCollection::associatedWidgetDestroyed(QObject *obj) {
+ _associatedWidgets.removeAll(static_cast<QWidget *>(obj));
+}
+
bool ActionCollection::unlistAction(QAction *action) {
// This might be called with a partly destroyed QAction!
bool ActionCollection::unlistAction(QAction *action) {
// This might be called with a partly destroyed QAction!
@@
-220,3
+228,5
@@
bool ActionCollection::unlistAction(QAction *action) {
return true;
}
return true;
}
+
+#endif /* HAVE_KDE */