/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* Parts of this implementation are based on KDE's KActionCollection. *
***************************************************************************/
+#ifndef HAVE_KDE
+
#include <QAction>
+#include <QDebug>
#include "actioncollection.h"
}
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;
}
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)
_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!
return true;
}
+
+#endif /* HAVE_KDE */