Commit 6e635df9 authored by David Faure's avatar David Faure

Add convenience DBus method `qdbus org.kde.konqueror /KonqMain urls`

(so I can find out if I can safely kill konqueror or if I was doing
something important with it which I need to finish first ;-)
parent 295ebd8c
......@@ -117,6 +117,22 @@ QList<QDBusObjectPath> KonquerorAdaptor::getWindows()
return lst;
}
QStringList KonquerorAdaptor::urls() const
{
QStringList lst;
QList<KonqMainWindow *> *mainWindows = KonqMainWindow::mainWindowList();
if (mainWindows) {
for (KonqMainWindow *window : *mainWindows) {
if (!window->isPreloaded()) {
for (KonqView *view : window->viewMap()) {
lst.append(view->url().toString());
}
}
}
}
return lst;
}
QDBusObjectPath KonquerorAdaptor::windowForTab()
{
QList<KonqMainWindow *> *mainWindows = KonqMainWindow::mainWindowList();
......
......@@ -72,6 +72,12 @@ public slots:
*/
QList<QDBusObjectPath> getWindows();
/**
* @return a list of all URLs currently opened in this process
* Convenience function to avoid iterating over windows by hand.
*/
QStringList urls() const;
/**
* Find a window which can be used for a new tab. Called by kfmclient.
*/
......
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