diff --git a/runners/CMakeLists.txt b/runners/CMakeLists.txt index abe294694..9d169038c 100644 --- a/runners/CMakeLists.txt +++ b/runners/CMakeLists.txt @@ -1,26 +1,23 @@ # add_subdirectory(browserhistory) add_subdirectory(converter) add_subdirectory(datetime) add_subdirectory(katesessions) # add_subdirectory(konquerorsessions) # add_subdirectory(kopete) # add_subdirectory(mediawiki) add_subdirectory(spellchecker) # add_subdirectory(characters) add_subdirectory(dictionary) # # if(KDEPIMLIBS_FOUND) -# if (NOT KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED) -# add_subdirectory(contacts) -# endif (NOT KDE_PLATFORM_FEATURE_DISABLE_DEPRECATED) # add_subdirectory(events) # endif(KDEPIMLIBS_FOUND) # # if(NOT WIN32) # add_subdirectory(konsolesessions) # endif(NOT WIN32) # # if(QJSON_FOUND) # add_subdirectory(youtube) # add_subdirectory(translator) # endif(QJSON_FOUND) diff --git a/runners/contacts/CMakeLists.txt b/runners/contacts/CMakeLists.txt deleted file mode 100644 index 3a3a7a072..000000000 --- a/runners/contacts/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(krunner_contacts_SRCS - contactsrunner.cpp - imageiconengine.cpp -) - -kde4_add_plugin(krunner_contacts ${krunner_contacts_SRCS}) -target_link_libraries(krunner_contacts ${KDE4_KIO_LIBS} ${KDE4_PLASMA_LIBS} -${KDEPIMLIBS_KABC_LIBS} ${KDE4_AKONADI_CONTACT_LIBS}) - -install(TARGETS krunner_contacts DESTINATION ${PLUGIN_INSTALL_DIR} ) - -install(FILES plasma-runner-contacts.desktop DESTINATION ${SERVICES_INSTALL_DIR}) - diff --git a/runners/contacts/Messages.sh b/runners/contacts/Messages.sh deleted file mode 100755 index 76309e1f6..000000000 --- a/runners/contacts/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -$XGETTEXT *.cpp -o $podir/plasma_runner_contacts.pot diff --git a/runners/contacts/contactsrunner.cpp b/runners/contacts/contactsrunner.cpp deleted file mode 100644 index 6a2c58ec6..000000000 --- a/runners/contacts/contactsrunner.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2007 Teemu Rytilahti - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "contactsrunner.h" - - -#include -#include -#include -#include -#include -/*#include - -*/ - -#include -#include -#include -#include - -#include "imageiconengine.h" - -ContactsRunner::ContactsRunner(QObject *parent, const QVariantList& args) - : Plasma::AbstractRunner(parent, args) -{ - Q_UNUSED(args); - setObjectName(QLatin1String( "Contacts" )); - - m_book = KABC::StdAddressBook::self(true /*asynchronous*/); - - m_icon = KIcon(QLatin1String( "internet-mail" )); - setIgnoredTypes(Plasma::RunnerContext::FileSystem | Plasma::RunnerContext::NetworkLocation); - addSyntax(Plasma::RunnerSyntax(QLatin1String( ":q:" ), i18n("Finds people in your address book matching :q:."))); - setDefaultSyntax(Plasma::RunnerSyntax(i18nc("list of all people in address book", "contacts"), - i18n("List all people in your address book."))); -} - -ContactsRunner::~ContactsRunner() -{ -} - -void ContactsRunner::match(Plasma::RunnerContext &context) -{ - const QString term = context.query().toLower(); - - if (term.size() < 3) { - return; - } - - QList matches; - - foreach (const KABC::Addressee &a, m_book->allAddressees()) { - if (!context.isValid()) { - return; - } - - bool matchedName; - bool matchedMail; - - if (term.compare(i18nc("list of all people in address book", "contacts"), Qt::CaseInsensitive) == 0 || term.compare(QLatin1String( "contacts" ), Qt::CaseInsensitive) == 0) { - matchedName = true; - matchedMail = true; - } else { - matchedName = a.realName().contains(term, Qt::CaseInsensitive); - matchedMail = false; - } - - if (!matchedName && !matchedMail) { - // Name didn't match, so lets try the name portion of the email address - const int indexOf = a.preferredEmail().indexOf(term, Qt::CaseInsensitive); - matchedMail = indexOf > -1 && indexOf < a.preferredEmail().indexOf(QLatin1Char( '@' )); - } - - if ((matchedName || matchedMail) && !a.preferredEmail().isEmpty()) { - //kDebug() << "Possible match: " << a.realName() << " <" << a.preferredEmail() << ">"; - Plasma::QueryMatch match(this); - - //TODO: exact match if the name is exact? =) - match.setType(Plasma::QueryMatch::PossibleMatch); - - if(!a.photo().isEmpty()) { - /* TODO it isn't anymore possible to use url as a photo for an user? - if(a.photo().isIntern()) { - } - else { - KURL url(a.photo().url()); - kDebug() << "photo url: " << url.prettyUrl() << endl; - if(url.isLocalFile()) { - icon = QIcon(url); - } - }*/ - QIcon icon(new ImageIconEngine(a.photo().data())); - match.setIcon(icon); - } else { - match.setIcon(m_icon); - } - - match.setText(i18nc("Open the default mail program to mail someone", "Mail to %1", a.realName())); - - if (!a.realName().isEmpty()) { - match.setData(QString(a.realName() + QLatin1String( " <" ) + a.preferredEmail() + QLatin1Char( '>' ))); - } else { - match.setData(a.preferredEmail()); - } - matches.append(match); - } - - if (matchedName) { - KABC::PhoneNumber::TypeList list; - list << KABC::PhoneNumber::Home - << KABC::PhoneNumber::Work - << KABC::PhoneNumber::Voice - << KABC::PhoneNumber::Cell - << KABC::PhoneNumber::Video - << KABC::PhoneNumber::Car; - foreach (const KABC::PhoneNumber::Type type, list) { - KABC::PhoneNumber phonenumber = a.phoneNumber(type); - if (!phonenumber.isEmpty()) { - //kDebug() << "Possible match: " << a.realName() << " tel: " << phonenumber.number(); - Plasma::QueryMatch match(this); - - //TODO: exact match if the name is exact? =) - match.setType(Plasma::QueryMatch::PossibleMatch); - - if (!a.photo().isEmpty()) { - /* TODO it isn't anymore possible to use url as a photo for an user? - if(a.photo().isIntern()) { - } - else { - KURL url(a.photo().url()); - kDebug() << "photo url: " << url.prettyUrl() << endl; - if(url.isLocalFile()) { - icon = QIcon(url); - } - }*/ - QIcon icon(new ImageIconEngine(a.photo().data())); - match.setIcon(icon); - } else { - match.setIcon(m_icon); - } - - match.setText(i18nc("Open the default telephone program to call someone", "Call %1 at %2", a.realName(), phonenumber.typeLabel())); - match.setSubtext(phonenumber.number()); - match.setData(QString(QLatin1String("call:") + phonenumber.number())); - matches.append(match); - } - } - } - } - - context.addMatches(term, matches); -} - -void ContactsRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) -{ - Q_UNUSED(context); - const QString address = match.data().toString(); - const QString name = match.text(); - - kDebug() << "run name '" << name << "' with address '" << address << "'"; - - if (address.startsWith(QLatin1String("call:"))) { - KABC::PhoneNumber number; - number.setNumber(address.mid(5)); - Akonadi::ContactDefaultActions actions; - actions.dialPhoneNumber( number ); - } else { - KToolInvocation::invokeMailer(address); - } -} - diff --git a/runners/contacts/contactsrunner.h b/runners/contacts/contactsrunner.h deleted file mode 100644 index 9bcb40d34..000000000 --- a/runners/contacts/contactsrunner.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2007 Teemu Rytilahti - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef CONTACTSRUNNER_H -#define CONTACTSRUNNER_H - -#include - -#include - -namespace KABC { - class AddressBook; -} - -class ContactsRunner : public Plasma::AbstractRunner { - Q_OBJECT - - public: - ContactsRunner( QObject *parent, const QVariantList& args ); - ~ContactsRunner(); - - void match(Plasma::RunnerContext &context); - void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match); - - private: - KABC::AddressBook *m_book; - KIcon m_icon; -}; - -K_EXPORT_PLASMA_RUNNER(contacts, ContactsRunner) - -#endif diff --git a/runners/contacts/imageiconengine.cpp b/runners/contacts/imageiconengine.cpp deleted file mode 100644 index 48b27a3b5..000000000 --- a/runners/contacts/imageiconengine.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2009 Christoph Feck - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "imageiconengine.h" - -#include -#include -#include -#include - -ImageIconEngine::ImageIconEngine(const QImage &image) - : m_image(image) -{ -} - -ImageIconEngine::~ImageIconEngine() -{ -} - -QSize ImageIconEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) -{ - Q_UNUSED(mode); - Q_UNUSED(state); - - return size; -} - -void ImageIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) -{ - painter->fillRect(rect, Qt::transparent); - QPixmap p = pixmap(rect.size(), mode, state); - QRect r = p.rect(); - r.moveCenter(rect.center()); - painter->drawPixmap(r, p); -} - -QPixmap ImageIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) -{ - Q_UNUSED(state); - - QImage image = m_image; - if (size.isValid() && size != image.size()) { - image = image.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); - } - - QStyleOption opt; - return QApplication::style()->generatedIconPixmap(mode, QPixmap::fromImage(image), &opt); -} - diff --git a/runners/contacts/imageiconengine.h b/runners/contacts/imageiconengine.h deleted file mode 100644 index a67ca421e..000000000 --- a/runners/contacts/imageiconengine.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2009 Christoph Feck - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef IMAGEICONENGINE_H -#define IMAGEICONENGINE_H - -#include -#include - -class ImageIconEngine : public QIconEngineV2 -{ - public: - ImageIconEngine(const QImage &image); - ~ImageIconEngine(); - - QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); - void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); - QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); - - private: - QImage m_image; -}; - -#endif diff --git a/runners/contacts/plasma-runner-contacts.desktop b/runners/contacts/plasma-runner-contacts.desktop deleted file mode 100644 index d3ac5f124..000000000 --- a/runners/contacts/plasma-runner-contacts.desktop +++ /dev/null @@ -1,124 +0,0 @@ -[Desktop Entry] -Name=Contacts -Name[ar]=جهات الاتصال -Name[bs]=Kontakti -Name[ca]=Contactes -Name[ca@valencia]=Contactes -Name[cs]=Kontakty -Name[da]=Kontakter -Name[de]=Kontakte -Name[el]=Επαφές -Name[en_GB]=Contacts -Name[eo]=Kontaktoj -Name[es]=Contactos -Name[et]=Kontaktid -Name[eu]=Kontaktuak -Name[fi]=Yhteystiedot -Name[fr]=Contacts -Name[ga]=Teagmhálacha -Name[gl]=Contactos -Name[he]=אנשי קשר -Name[hr]=Kontakti -Name[hu]=Névjegyek -Name[ia]=Contactos -Name[is]=Tengiliðir -Name[it]=Contatti -Name[ja]=連絡先 -Name[kk]=Контакттар -Name[km]=ទំនាក់ទំនង -Name[ko]=연락처 -Name[ku]=Têkilî -Name[lt]=Kontaktai -Name[lv]=Kontakti -Name[mr]=संपर्क -Name[nb]=Kontakter -Name[nds]=Kontakten -Name[nl]=Contactpersonen -Name[nn]=Kontaktar -Name[pa]=ਸੰਪਰਕ -Name[pl]=Kontakty -Name[pt]=Contactos -Name[pt_BR]=Contatos -Name[ro]=Contacte -Name[ru]=Контакты -Name[sk]=Kontakty -Name[sl]=Stiki -Name[sq]=Kontakte -Name[sr]=контакти -Name[sr@ijekavian]=контакти -Name[sr@ijekavianlatin]=kontakti -Name[sr@latin]=kontakti -Name[sv]=Kontakter -Name[th]=ที่อยู่ติดต่อ -Name[tr]=Kişiler -Name[ug]=ئالاقەداشلار -Name[uk]=Контакти -Name[wa]=Soçons -Name[x-test]=xxContactsxx -Name[zh_CN]=联系人 -Name[zh_TW]=聯絡人 -Comment=Finds entries in your address book -Comment[ar]=تبحث عن مدخلات في دفتر العناوين -Comment[bs]=Pronalazi unose u vašem adresaru -Comment[ca]=Cerca entrades a la llibreta d'adreces -Comment[ca@valencia]=Busca entrades a la llibreta d'adreces -Comment[cs]=Vyhledávání položek v adresáři -Comment[da]=Finder indgange i din adressebog. -Comment[de]=Einträge in Ihrem Adressbuch suchen -Comment[el]=Αναζητά καταχωρήσεις στο βιβλίο διευθύνσεών σας -Comment[en_GB]=Finds entries in your address book -Comment[es]=Busca entradas en su libreta de direcciones -Comment[et]=Kirjete otsimine aadressiraamatust -Comment[eu]=Zure helbide liburuan sarrerak aurkitzen ditu -Comment[fi]=Etsii yhteystietoja osoitekirjasta -Comment[fr]=Trouve des entrées dans votre carnet d'adresses -Comment[ga]=Aimsigh teagmhálacha i do leabhar seoltaí -Comment[gl]=Atopa entradas no caderno de enderezos -Comment[he]=מצא רשומות מתוך האנשי קשר שלך -Comment[hr]=Traži unose u vašem adresaru -Comment[hu]=Bejegyzések keresése a címjegyzékben -Comment[is]=Finnur færslur í heimilisfangaskránni -Comment[it]=Cerca voci nella rubrica dei contatti -Comment[ja]=アドレス帳のエントリを見つけます -Comment[kk]=Адрестік кітапшаңызды ақтару -Comment[km]=រក​ធាតុ​នៅ​ក្នុង​សៀវភៅ​អាសយដ្ឋាន​របស់​អ្នក -Comment[ko]=주소록에서 항목 찾기 -Comment[ku]=Têketinên di pirtûka navnîşanan de dibîne -Comment[lt]=Randa įrašus jūsų adresų knygelėje -Comment[lv]=Atrod ierakstus adrešu grāmatā -Comment[mr]=तुमच्या पत्ता पुस्तकातील नोंदी शोधतो -Comment[nb]=Finner oppføringer i adresseboka -Comment[nds]=Indrääg binnen Dien Adressbook söken -Comment[nl]=Doorzoekt ingangen in uw adresboek -Comment[nn]=Finn oppføringar i adresseboka -Comment[pa]=ਆਪਣੀ ਐਡਰੈੱਸ ਬੁੱਕ ਵਿੱਚ ਐਂਟਰੀਆਂ ਲੱਭੋ -Comment[pl]=Wyszukuje wpisów w twojej książce adresowej -Comment[pt]=Descobre elementos no seu livro de endereços -Comment[pt_BR]=Localiza entradas no seu livro de endereços -Comment[ro]=Găsește adrese în cartea de adrese -Comment[ru]=Поиск записей в адресной книге -Comment[sk]=Vyhľadávanie položiek vo vašom adresári -Comment[sl]=Najde stike iz vašega imenika -Comment[sr]=Потражите уносе кроз адресар -Comment[sr@ijekavian]=Потражите уносе кроз адресар -Comment[sr@ijekavianlatin]=Potražite unose kroz adresar -Comment[sr@latin]=Potražite unose kroz adresar -Comment[sv]=Hittar poster i din adressbok -Comment[th]=ค้นรายการในสมุดที่อยู่ของคุณ -Comment[tr]=Adres defterinizdeki arkadaşlarınız -Comment[uk]=Знайти записи у вашій адресній книзі -Comment[wa]=Trove des intrêyes dins vosse calpin d' adresses -Comment[x-test]=xxFinds entries in your address bookxx -Comment[zh_CN]=在地址簿里查找条目 -Comment[zh_TW]=找到通訊錄中的聯絡人 -ServiceTypes=Plasma/Runner -Type=Service -Icon=internet-mail -X-KDE-Library=krunner_contacts -X-KDE-PluginInfo-Author=Teemu Rytilahti -X-KDE-PluginInfo-Email=tpr@iki.fi -X-KDE-PluginInfo-Name=kabccontacts -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-License=LGPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-AdvertiseSingleRunnerQueryMode=true