Fix off by one error causing the scrollbar to show up.
[kdepim.git] / akonadiconsole / main.cpp
blob562879038a08aeba49875e244aeaa91a6a0a76e1
1 /*
2 This file is part of Akonadi.
4 Copyright (c) 2006 Tobias Koenig <tokoe@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 USA.
22 #include <kaboutdata.h>
23 #include <kapplication.h>
24 #include <kcmdlineargs.h>
25 #include <kdebug.h>
27 #include "mainwindow.h"
29 #include <stdlib.h>
31 int main( int argc, char **argv )
33 KAboutData aboutData( "akonadiconsole", 0,
34 ki18n( "Akonadi Console" ),
35 "0.99",
36 ki18n( "The Management and Debugging Console for Akonadi" ),
37 KAboutData::License_GPL,
38 ki18n( "(c) 2006-2008 the Akonadi developer" ),
39 KLocalizedString(),
40 "http://pim.kde.org/akonadi/" );
41 aboutData.setProgramIconName( "akonadi" );
42 aboutData.addAuthor( ki18n( "Tobias König" ), ki18n( "Author" ), "tokoe@kde.org" );
43 aboutData.addAuthor( ki18n( "Volker Krause" ), ki18n( "Author" ), "vkrause@kde.org" );
45 KCmdLineArgs::init( argc, argv, &aboutData );
46 KCmdLineOptions options;
47 options.add( "remote <server>", ki18n("Connect to an Akonadi remote debugging server"));
48 KCmdLineArgs::addCmdLineOptions( options );
50 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
51 if ( args->isSet( "remote" ) ) {
52 const QString akonadiAddr = QString::fromLatin1( "tcp:host=%1,port=31415" ).arg( args->getOption( "remote" ) );
53 const QString dbusAddr = QString::fromLatin1( "tcp:host=%1,port=31416" ).arg( args->getOption( "remote" ) );
54 setenv( "AKONADI_SERVER_ADDRESS", akonadiAddr.toLatin1(), 1 );
55 setenv( "DBUS_SESSION_BUS_ADDRESS", dbusAddr.toLatin1(), 1 );
58 KApplication app;
60 MainWindow *window = new MainWindow;
61 if ( args->isSet( "remote" ) )
62 window->setWindowTitle( i18n( "Remote Akonadi Console (%1)", args->getOption( "remote" ) ) );
63 window->show();
65 return app.exec();