Commit ff16c0e7 authored by Lukas Appelhans's avatar Lukas Appelhans

Transfer to polkit and readd a couple of features

parent bf2266a7
......@@ -23,11 +23,11 @@ Q_OBJECT
public:
explicit OperationManager(APM::OperationType type, QList< APM::OperationName > operations, QHash<APM::OptionName, QStringList> options, QStringList args, QObject* parent = 0);
virtual ~OperationManager();
private slots:
void statusChanged(Akabei::Backend::Status);
void start();
private:
APM::OperationType m_type;
QList<APM::OperationName> m_operations;
......
......@@ -394,19 +394,19 @@ void QueryOperation::showNotRequired(QUuid uuid, QList< Akabei::Package* > orpha
nextOperation();
return;
}
QTextStream out(stdout);
if (orphans.isEmpty()) {
out << "No packages found!" << endl;
}
foreach (Akabei::Package* orphan, orphans) {
if (!isIgnored(orphan)) {
out << orphan->name() << ' ' << orphan->version().toByteArray().data() << endl;
}
}
out.flush();
nextOperation();
}
......
......@@ -39,10 +39,10 @@ RemoveOperation::~RemoveOperation()
void RemoveOperation::start()
{
APM::OperationName operation = m_operations.takeFirst();
Akabei::Backend* backend = Akabei::Backend::instance();
Akabei::Database *localDatabase = backend->localDatabase();
if (operation == APM::Unneeded) {
connect(backend, SIGNAL(queryOrphansCompleted(QUuid,QList<Akabei::Package*>)), SLOT(removeUnneeded(QUuid,QList<Akabei::Package*>)));
id = Akabei::Backend::instance()->orphanPackages();
......@@ -90,7 +90,7 @@ void RemoveOperation::removeUnneeded(QUuid uuid, QList< Akabei::Package* > orpha
nextOperation();
return;
}
QueueOperation* operation = new QueueOperation(APM::Unneeded, m_options, this);
connect(operation, SIGNAL(finished()), SLOT(nextOperation()));
operation->start(AkabeiClient::Remove, orphans);
......
project(akabei)
# Installs the bash completion scripts
install(FILES akabei DESTINATION "/etc/bash_completion.d")
install(FILES pakabei DESTINATION "/etc/bash_completion.d")
install(FILES akabei DESTINATION "/usr/share/bash-completion/completions")
install(FILES pakabei DESTINATION "/usr/share/bash-completion/completions")
# installs the configuration script and creates a symlink to it
install(FILES akabei-conf-import.py
......
......@@ -133,7 +133,7 @@ void SyncOperation::updateDatabases()
currentDatabase = AkabeiClient::Backend::instance()->databases().constBegin();
lastDatabase = AkabeiClient::Backend::instance()->databases().constEnd();
updateNextDatabase();
Akabei::Backend::instance()->setStatus(Akabei::Backend::StatusOnTransaction, this, "updateNextDatabase");
}
void SyncOperation::updateSystem()
......@@ -327,7 +327,9 @@ void SyncOperation::showGroup(QUuid uuid,QList<Akabei::Group*> groups)
void SyncOperation::updateNextDatabase()
{
qDebug() << "Actually update db";
if (currentDatabase == lastDatabase) {
Akabei::Backend::instance()->setStatus(Akabei::Backend::StatusReady);
QTextStream out(stdout);
out << i18n("Updating all databases finished") << endl;
nextOperation();
......@@ -396,3 +398,4 @@ void SyncOperation::nextOperation()
}
start();
}
......@@ -39,14 +39,16 @@ private slots:
void nextOperation();
public slots:
void updateNextDatabase();
private:
QList<AkabeiClient::DatabaseHandler*>::const_iterator currentDatabase;
QList<AkabeiClient::DatabaseHandler*>::const_iterator lastDatabase;
int m_maxDbNameLenght;
void updateDatabases();
void updateSystem();
void updateNextDatabase();
void updateDatabases();
bool isIgnored(Akabei::Package *);
......
......@@ -70,11 +70,11 @@ void printPackageInformation(Akabei::Package const * p, QTextStream &out, bool s
out << "\t" << qSetFieldWidth(n) << fields["Homepage:"] << qSetFieldWidth(0) << p->url().toString() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Licenses:"] << qSetFieldWidth(0) << (p->licenses().isEmpty() ? i18n("None") : p->licenses().join(" ")) << endl;
out << "\t" << qSetFieldWidth(n) << fields["Depends on:"] << qSetFieldWidth(0) << (p->dependencies().isEmpty() ? i18n("None") : p->dependencies().join(" ")) << endl;
if (showMakeDeps) {
out << "\t" << qSetFieldWidth(n) << fields["Make dependencies:"] << qSetFieldWidth(0) << (p->makeDependencies().isEmpty() ? i18n("None") : p->makeDependencies().join(" ")) << endl;
}
out << "\t" << qSetFieldWidth(n) << fields["Optional dependencies:"] << qSetFieldWidth(0) << (p->optionalDependencies().isEmpty() ? i18n("None") : p->optionalDependencies().join(" ")) << endl;
out << "\t" << qSetFieldWidth(n) << fields["Replaces:"] << qSetFieldWidth(0) << (p->replaces().isEmpty() ? i18n("None") : p->replaces().join(" ")) << endl;
out << "\t" << qSetFieldWidth(n) << fields["Packager:"] << qSetFieldWidth(0) << p->packager() << endl;
......
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