25 #include <tqstringlist.h>
28 #include <tdecmdlineargs.h>
29 #include <tdelocale.h>
30 #include <knotifyclient.h>
31 #include <tdeuniqueapplication.h>
33 #include "aboutdata.h"
34 #include "mainwindow.h"
35 #include "akregator_options.h"
39 class Application : public TDEUniqueApplication {
41 Application() : mMainWindow( ) {}
50 int Application::newInstance()
54 DCOPRef akr( "akregator", "AkregatorIface");
56 TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
60 setMainWidget( mMainWindow );
61 mMainWindow->loadPart();
62 mMainWindow->setupProgressWidgets();
63 if (!args->isSet( "hide-mainwindow"))
65 akr.send( "openStandardFeedList");
68 TQString addFeedGroup = !args->getOption( "group").isEmpty()
69 ? TQString::fromLocal8Bit(args->getOption( "group"))
70 : i18n( "Imported Folder");
72 QCStringList feeds = args->getOptionList( "addfeed");
73 TQStringList feedsToAdd;
74 QCStringList::ConstIterator end( feeds.end() );
75 for (QCStringList::ConstIterator it = feeds.begin(); it != end; ++it)
76 feedsToAdd.append(*it);
78 if (!feedsToAdd.isEmpty())
79 akr.send( "addFeedsToGroup", feedsToAdd, addFeedGroup );
83 return TDEUniqueApplication::newInstance();
88 int main( int argc, char **argv)
91 TDECmdLineArgs::init(argc, argv, &about);
92 TDECmdLineArgs::addCmdLineOptions( Akregator::akregator_options );
93 TDEUniqueApplication::addCmdLineOptions();
95 Akregator::Application app;
98 KNotifyClient::startDaemon();
101 if (app.isRestored())
104 #define RESTORE(type) { int n = 1;\
105 while (TDEMainWindow::canBeRestored(n)){\
106 (new type)->restore(n, false);\
This is the application "Shell".
|