SVN commit 1043180 by sebas: cleanups, docs, ... M +3 -0 mediawiki.cpp M +30 -22 mediawiki.h M +4 -7 mediawikirunner.cpp M +1 -1 techbaserunner.desktop M +1 -1 userbaserunner.desktop --- trunk/playground/base/plasma/runners/mediawiki/mediawiki.cpp #1043179:1043180 @@ -1,5 +1,6 @@ /* * Copyright 2009 by Richard Moore + * Copyright 2009 by Sebastian Kügler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -49,6 +50,7 @@ { d = new MediaWikiPrivate; d->state = StateApiChanged; + // should be overwritten by the user d->apiUrl = QUrl("http://en.wikipedia.org/w/api.php"); d->manager = new QNetworkAccessManager( this ); d->maxItems = 10; @@ -156,6 +158,7 @@ if ( d->state == StateApiUpdating ) { bool ok = processBaseResult( reply ); + Q_UNUSED ( ok ); reply->deleteLater(); reply= 0; d->state = StateReady; --- trunk/playground/base/plasma/runners/mediawiki/mediawiki.h #1043179:1043180 @@ -1,5 +1,6 @@ /* * Copyright 2009 by Richard Moore + * Copyright 2009 by Sebastian Kügler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -40,63 +41,70 @@ * Contains information about a single match from the search. */ class Result { - public: - Result() { - }; + public: + Result() { + }; - Result( const Result &r ) { - this->title = r.title; - this->url = r.url; - }; + Result( const Result &r ) { + this->title = r.title; + this->url = r.url; + }; - Result &operator= (const Result &other) { - this->title = other.title; - this->url = other.url; + Result &operator= (const Result &other) { + this->title = other.title; + this->url = other.url; - return *this; - }; + return *this; + }; - /** The page title of the match. */ - QString title; - /** The URL of the page containing the match. */ - QUrl url; + /** The page title of the match. */ + QString title; + /** The URL of the page containing the match. */ + QUrl url; }; /** * Create a media wiki querying object with the specified parent. The querying * object can be used for multple queries, though only one can be performed at * a time. + * @param parent The parent object */ MediaWiki( QObject *parent=0 ); virtual ~MediaWiki(); /** - * Returns a list of matches. + * @returns a list of matches. */ QList results() const; - /** Returns the currently specified maximum number of results to return. */ + /** @returns the currently specified maximum number of results to return. */ int maxItems() const; - /** Sets the maximum number of results to return. */ + /** Sets the maximum number of results to return. + * + * @param limit Maximumber number of results to retrieve + */ void setMaxItems( int limit ); - /** Returns the currently specified API URL. */ + /** @returns the currently specified API URL. */ QUrl apiUrl() const; /** * Sets the URL at which the wikis API page can be found. For example, wikipedia * has the API file at http://en.wikipedia.org/w/api.php whilst techbase has the - * file at http://techbase.kde.org/api.php. + * + * @param url The URL of the api.php file, for example http://techbase.kde.org/api.php */ void setApiUrl( const QUrl &url ); - /** Returns the currently specified timeout in milliseconds. */ + /** @returns the currently specified timeout in milliseconds. */ int timeout() const; /** * Sets timeout in milliseconds. Once the specified time has elapsed, the current * query is aborted. + * + * @param millis Query timeout in milliseconds */ void setTimeout( int millis ); --- trunk/playground/base/plasma/runners/mediawiki/mediawikirunner.cpp #1043179:1043180 @@ -1,5 +1,5 @@ /* - * Copyright 2008, 2009 Sebastian Kügler + * Copyright 2009 Sebastian Kügler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -46,19 +46,16 @@ kDebug() << info.name() << info.property("X-Plasma-Args").toStringList() << _urls.count(); if (_urls.count()) { m_apiUrl = _urls[0]; - kDebug() << _u << m_name << m_comment; + } else { + kWarning() << "No X-Plasma-Args found in .desktop file"; } m_name = info.name(); m_comment = info.comment(); m_icon = KIcon(info.icon()); } - kDebug() << "ID:" << id(); - Plasma::RunnerSyntax s(":q:", i18n("Finds entries on Wikipedia matching :q:.")); - s.addExampleQuery(":q:"); - addSyntax(s); - addSyntax(Plasma::RunnerSyntax("wikipedia", i18n("Finds entries on Wikipedia."))); + addSyntax(Plasma::RunnerSyntax(":q:", i18n("Searches %1 for :q:.", m_name))); setSpeed( SlowSpeed ); } --- trunk/playground/base/plasma/runners/mediawiki/techbaserunner.desktop #1043179:1043180 @@ -6,7 +6,7 @@ X-KDE-ServiceTypes=Plasma/Runner Type=Service X-KDE-Library=krunner_mediawiki -X-KDE-PluginInfo-Author=Sebastian K?gler +X-KDE-PluginInfo-Author=Sebastian Kügler X-KDE-PluginInfo-Email=sebas@kde.org X-KDE-PluginInfo-Name=techbase X-KDE-PluginInfo-Version=1.0 --- trunk/playground/base/plasma/runners/mediawiki/userbaserunner.desktop #1043179:1043180 @@ -6,7 +6,7 @@ X-KDE-ServiceTypes=Plasma/Runner Type=Service X-KDE-Library=krunner_mediawiki -X-KDE-PluginInfo-Author=Sebastian K?gler +X-KDE-PluginInfo-Author=Sebastian Kügler X-KDE-PluginInfo-Email=sebas@kde.org X-KDE-PluginInfo-Name=userbase X-KDE-PluginInfo-Version=1.0