diff --git a/desktop/org.kde.kget.desktop.cmake b/desktop/org.kde.kget.desktop.cmake index c1178c93..da6c1687 100755 --- a/desktop/org.kde.kget.desktop.cmake +++ b/desktop/org.kde.kget.desktop.cmake @@ -1,163 +1,163 @@ # KDE Config File [Desktop Entry] Type=Application -Exec=kget -qwindowtitle %c %i %U +Exec=kget -qwindowtitle %c %U Icon=kget Terminal=false MimeType=@SUPPORTED_KGET_MIMETYPES@ Name=KGet Name[ar]=KGet Name[be]=KGet Name[bg]=KGet Name[bn]=কে-গেট Name[br]=KGet Name[bs]=KGet Name[ca]=KGet Name[ca@valencia]=KGet Name[cs]=KGet Name[cy]=KNôl Name[da]=KGet Name[de]=KGet Name[el]=KGet Name[en_GB]=KGet Name[eo]=KGet Name[es]=KGet Name[et]=KGet Name[eu]=KGet Name[fi]=KGet Name[fr]=KGet Name[ga]=KGet Name[gl]=KGet Name[he]=KGet Name[hi]=के-गेट Name[hne]=के-गेट Name[hr]=KGet Name[hu]=KGet Name[ia]=KGet Name[id]=KGet Name[is]=KGet Name[it]=KGet Name[ja]=KGet Name[kk]=KGet Name[km]=KGet Name[ko]=KGet Name[lt]=KGet Name[lv]=KGet Name[mk]=KGet Name[ml]=കെഗെറ്റ് Name[mr]=के-गेट Name[ms]=KGet Name[nb]=KGet Name[nds]=KGet Name[ne]=केडीई गेट Name[nl]=KGet Name[nn]=KGet Name[pa]=ਕੇ-ਗੈੱਟ Name[pl]=KGet Name[pt]=KGet Name[pt_BR]=KGet Name[ro]=KGet Name[ru]=KGet Name[se]=KGet Name[si]=KGet Name[sk]=KGet Name[sl]=KGet Name[sq]=KGet Name[sr]=К‑гет Name[sr@ijekavian]=К‑гет Name[sr@ijekavianlatin]=KGet Name[sr@latin]=KGet Name[sv]=Kget Name[ta]=கேகெட் Name[tg]=KGet Name[th]=ดาวน์โหลด-K Name[tr]=KGet Name[ug]=KGet Name[uk]=KGet Name[vi]=KGet Name[wa]=KGet Name[xh]=KGet Name[x-test]=xxKGetxx Name[zh_CN]=KGet Name[zh_HK]=KGet Name[zh_TW]=檔案傳輸_KGet GenericName=Download Manager GenericName[ar]=مدير التّنزيل GenericName[be]=Праграма сцягвання файлаў GenericName[bg]=Изтегляне на файлове GenericName[bn]=ডাউনলোড ম্যানেজার GenericName[br]=Merour enkargañ GenericName[bs]=Menadžer preuzimanja GenericName[ca]=Gestor de baixades GenericName[ca@valencia]=Gestor de baixades GenericName[cs]=Správce stahování GenericName[cy]=Rheolydd Lawrlwytho GenericName[da]=Håndtering af download GenericName[de]=Download-Verwaltung GenericName[el]=Διαχειριστής λήψεων αρχείων GenericName[en_GB]=Download Manager GenericName[eo]=Elŝuta administrilo GenericName[es]=Gestor de descargas GenericName[et]=Allalaadimiste haldur GenericName[eu]=Deskarga-kudeatzailea GenericName[fa]=مدیر بارگیری GenericName[fi]=Tiedostonlataaja GenericName[fr]=Gestionnaire de téléchargements GenericName[ga]=Bainisteoir Íosluchtaithe GenericName[gl]=Xestor de descargas GenericName[he]=מנהל הורדות GenericName[hi]=डाउनलोड प्रबंधक GenericName[hne]=डाउनलोड प्रबंधक GenericName[hr]=Upravitelj preuzimanja GenericName[hu]=Letöltéskezelő GenericName[ia]=Gerente de discargamento GenericName[id]=Download Manager GenericName[is]=Niðurhalsstjóri GenericName[it]=Gestore degli scaricamenti GenericName[ja]=ダウンロードマネージャ GenericName[kk]=Жүктеп алу менеджері GenericName[km]=កម្មវិធី​គ្រប់គ្រង​ការ​ទាញយក GenericName[ko]=다운로드 관리자 GenericName[lt]=Siuntimų valdymas GenericName[lv]=Lejupielāžu pārvaldnieks GenericName[mk]=Менаџер за симнувања GenericName[ml]=ഇറക്കിവെക്കല്‍ കാര്യസ്ഥന്‍ GenericName[mr]=डाउनलोड व्यवस्थापक GenericName[nb]=Nedlastingsbehandler GenericName[nds]=Daalladenpleger GenericName[ne]=डाउनलोड प्रबन्धक GenericName[nl]=Downloadbeheerder GenericName[nn]=Nedlastingshandsamar GenericName[pa]=ਡਾਊਨਲੋਡ ਮੈਨੇਜਰ GenericName[pl]=Zarządzanie pobieraniem GenericName[pt]=Gestor de Transferências GenericName[pt_BR]=Gerenciador de downloads GenericName[ro]=Administrator descărcări GenericName[ru]=Диспетчер загрузок GenericName[si]=බාගැනීම් කළමනාකරු GenericName[sk]=Správca sťahovania GenericName[sl]=Upravljalnik prenosov GenericName[sq]=Organizuesi i Shkarkimeve GenericName[sr]=Менаџер преузимања GenericName[sr@ijekavian]=Менаџер преузимања GenericName[sr@ijekavianlatin]=Menadžer preuzimanja GenericName[sr@latin]=Menadžer preuzimanja GenericName[sv]=Nerladdningshanterare GenericName[ta]=பதிவிறக்க மேலாளர் GenericName[tg]=Мудири Боркунӣ GenericName[th]=เครื่องมือจัดการการดาวน์โหลด GenericName[tr]=İndirme Yöneticisi GenericName[ug]=چۈشۈرۈش باشقۇرغۇسى GenericName[uk]=Керування отриманнями GenericName[uz]=Yozib olish boshqaruvchisi GenericName[uz@cyrillic]=Ёзиб олиш бошқарувчиси GenericName[vi]=Trình quản lý việc tải tập tin GenericName[wa]=Manaedjeu d' aberwetaedje GenericName[x-test]=xxDownload Managerxx GenericName[zh_CN]=下载管理器 GenericName[zh_HK]=下載管理員 GenericName[zh_TW]=下載管理員 Categories=Qt;KDE;Network;FileTransfer; X-DBUS-ServiceType=Unique X-DocPath=kget/index.html X-DBUS-ServiceName=org.kde.kget diff --git a/main.cpp b/main.cpp index c5b67005..4fdeb460 100644 --- a/main.cpp +++ b/main.cpp @@ -1,184 +1,185 @@ /* This file is part of the KDE project Copyright (C) 2002 by Patrick Charbonnier Based On Caitoo v.0.7.3 (c) 1998 - 2000, Matej Koss This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include #include #include #include #include #include #include #include #include "core/kget.h" #include "dbus/dbuskgetwrapper.h" #include "mainadaptor.h" #include "settings.h" #include "mainwindow.h" #include "ui/newtransferdialog.h" #include "kget_version.h" class KGetApp : public QObject { public: KGetApp(QCommandLineParser *p) : kget( nullptr ), parser( p ) { } ~KGetApp() { delete kget; } int newInstance() { if (!kget) { #ifdef DEBUG kget = new MainWindow(!parser->isSet("showDropTarget"), parser->isSet("startWithoutAnimation"), parser->isSet("test")); #else kget = new MainWindow(!parser->isSet("showDropTarget"), parser->isSet("startWithoutAnimation"), false); #endif DBusKGetWrapper *wrapper = new DBusKGetWrapper(kget); new MainAdaptor(wrapper); QDBusConnection::sessionBus().registerObject("/KGet", wrapper); } else { // activate window if it is already open KStartupInfo::setNewStartupId(kget, KStartupInfo::startupId()); KWindowSystem::forceActiveWindow(kget->winId()); } if (parser->isSet("showDropTarget")) Settings::setShowDropTarget( true ); QList l; const QStringList args = parser->positionalArguments(); for (int i = 0; i < args.count(); i++) { QString txt(args.at(i)); if ( txt.endsWith( QLatin1String(".kgt"), Qt::CaseInsensitive ) ) KGet::load( txt ); else l.push_back(QUrl::fromUserInput(args.at(i))); } if (!l.isEmpty()) NewTransferDialogHandler::showNewTransferDialog(l); return 0; } public slots: void slotActivateRequested (QStringList args, const QString & /*workingDir*/) { parser->parse(args); newInstance(); } private: MainWindow * kget; QCommandLineParser *parser; }; int main(int argc, char *argv[]) { QApplication app(argc, argv); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); KLocalizedString::setApplicationDomain("kget"); KAboutData aboutData(QStringLiteral("kget"), i18n("KGet"), QStringLiteral(KGET_VERSION_STRING), i18n("An advanced download manager by KDE"), KAboutLicense::GPL, i18n("(C) 2005 - 2014, The KGet developers\n" "(C) 2001 - 2002, Patrick Charbonnier\n" "(C) 2002, Carsten Pfeiffer\n" "(C) 1998 - 2000, Matej Koss"), i18n("kget@kde.org")); aboutData.addAuthor(i18n("Lukas Appelhans"), i18n("Maintainer, Core Developer, Torrent Plugin Author"), "l.appelhans@gmx.de"); aboutData.addAuthor(i18n("Dario Massarin"), i18n("Core Developer"), "nekkar@libero.it"); aboutData.addAuthor(i18n("Urs Wolfer"), i18n("Core Developer"), "uwolfer@kde.org"); aboutData.addAuthor(i18n("Manolo Valdes"), i18n("Core Developer, Multithreaded Plugin Author"), "nolis71cu@gmail.com"); aboutData.addAuthor(i18n("Matthias Fuchs"), i18n("Core Developer"), "mat69@gmx.net"); aboutData.addAuthor(i18n("Javier Goday"), i18n("Developer"), "jgoday@gmail.com"); aboutData.addAuthor(i18n("Aish Raj Dahal"), i18n("Google Summer of Code Student")); aboutData.addAuthor(i18n("Ernesto Rodriguez Ortiz"), i18n("Mms Plugin Author"), "eortiz@uci.cu"); aboutData.addAuthor(i18n("Patrick Charbonnier"), i18n("Former Developer"), "pch@freeshell.org"); aboutData.addAuthor(i18n("Carsten Pfeiffer"), i18n("Former Developer"), "pfeiffer@kde.org"); aboutData.addAuthor(i18n("Matej Koss"), i18n("Former Developer")); aboutData.addCredit(i18n("Joris Guisson"), i18n("BTCore (KTorrent) Developer"), "joris.guisson@gmail.com"); aboutData.addCredit(i18n("Mensur Zahirovic (Nookie)"), i18n("Design of Web Interface"), "linuxsajten@gmail.com"); // necessary to make the "Translators" tab appear in the About dialog aboutData.setTranslator( i18nc( "NAME OF TRANSLATORS", "Your names" ), i18nc( "EMAIL OF TRANSLATORS", "Your emails" ) ); KAboutData::setApplicationData(aboutData); + QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kget"))); QCommandLineParser parser; aboutData.setupCommandLine(&parser); parser.addOption(QCommandLineOption(QStringList() << QLatin1String("showDropTarget"), i18n("Start KGet with drop target"))); parser.addOption(QCommandLineOption(QStringList() << QLatin1String("hideMainWindow"), i18n("Start KGet with hidden main window"))); parser.addOption(QCommandLineOption(QStringList() << QLatin1String("startWithoutAnimation"), i18n("Start KGet without drop target animation"))); #ifdef DEBUG parser.addOption(QCommandLineOption(QStringList() << QLatin1String("test"), i18n("Execute Unit Testing"))); #endif parser.addPositionalArgument(QLatin1String("[URL(s)]"), i18n("URL(s) to download")); parser.process(app); aboutData.processCommandLine(&parser); KDBusService dbusService(KDBusService::Unique); Kdelibs4ConfigMigrator migrate(QStringLiteral("kget")); migrate.setConfigFiles(QStringList() << QStringLiteral("kgetrc") << QStringLiteral("kget_bittorrentfactory.rc") << QStringLiteral("kget_checksumsearchfactory.rc") << QStringLiteral("kget_metalinkfactory.rc") << QStringLiteral("kget_mirrorsearchfactory.rc") << QStringLiteral("kget_mmsfactory.rc") << QStringLiteral("kget_multisegkiofactory.rc") << QStringLiteral("kget.notifyrc")); if (migrate.migrate()) { Kdelibs4Migration dataMigrator; const QString sourceBasePath = dataMigrator.saveLocation("data", QStringLiteral("kget")); const QString targetBasePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/kget/"); QString targetFilePath; QDir sourceDir(sourceBasePath); QDir targetDir(targetBasePath); if (sourceDir.exists()) { if (!targetDir.exists()) { QDir().mkpath(targetBasePath); } QStringList fileNames = sourceDir.entryList( QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks); foreach (const QString &fileName, fileNames) { targetFilePath = targetBasePath + fileName; if (!QFile::exists(targetFilePath)) { QFile::copy(sourceBasePath + fileName, targetFilePath); } } } } KGetApp kApp(&parser); QObject::connect(&dbusService, &KDBusService::activateRequested, &kApp, &KGetApp::slotActivateRequested); kApp.newInstance(); return app.exec(); }