Commit 24519792 authored by Lukas Appelhans's avatar Lukas Appelhans

Basically put all in what was in guzuta

parent bcf0bc6f
cmake_minimum_required(VERSION 2.6)
find_package(KDE4 REQUIRED)
add_executable(akabei main.cpp)
include (KDE4Defaults)
include (MacroLibrary)
set(apm_SRCS apm.cpp main.cpp)
kde4_add_executable(akabei ${apm_SRCS})
target_link_libraries(akabei ${KDE4_KDEUI_LIBRARY} akabeiclient)
#include <iostream>
/* This file is part of the Chakra project
int main(int argc, char **argv) {
std::cout << "Hello, world!" << std::endl;
return 0;
Copyright (C) 2011 Lukas Appelhans <>
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 <kcmdlineargs.h>
#include <klocalizedstring.h>
#include <kuniqueapplication.h>
#include <kaboutdata.h>
#include <kdebug.h>
#include "apm.h"
int main(int argc, char** argv)
KAboutData aboutData("akabei", 0, ki18n("Akabei"),
ki18n("Chakra's CLI package manager"),
ki18n("(C) 2011 Lukas Appelhans"),
ki18n("<a href=\"\"></a>"));
aboutData.addAuthor(ki18n("Lukas Appelhans"), ki18n("Maintainer"), "");
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineOptions options;
options.add("S", ki18n("Sync operation"));
options.add("y", ki18n("Refresh database"));
options.add("u", ki18n("Update system"));
// Add options from other components
if (!KUniqueApplication::start()) {
fprintf(stderr, "Akabei is already running!\n");
return 0;
KUniqueApplication app;
//kError() << "asd";
//kDebug() << "blub";
//fprintf(stdout, "asdsad\n");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QList<APM::Operation> list;
APM::OperationType type = APM::NoType;
if (args->isSet("S")) {
type = APM::SyncOperation;
if (args->isSet("y"))
if (args->isSet("y"))
QStringList rest;
for (int i = 0; i < args->count(); i++)
rest << args->arg(i);
args->clear(); // Free up some memory
APM apm;
apm.start(type, list, rest);
/* // A binary option (on / off)
if (args->isSet("some-option"))
// An option which takes an additional argument
QString anotherOptionArg = args->getOption("another-option");
// Arguments (e.g. files to open)
for(int i = 0; i < args->count(); i++) // Counting start at 0!
openFile( args->arg(i));
// Or more convenient:
// openUrl( args->url(i));
args->clear(); // Free up some memory.
return app.exec();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment