Commit 74930e61 authored by Lukas Appelhans's avatar Lukas Appelhans

-Syy implemented

parent 2ae659e9
......@@ -80,6 +80,7 @@ enum OperationName {
ListRepo,
Newest,
UpdateDatabases,
ForceUpdateDatabases,
UpdateSystem,
UpgradeSystem,
Remove,
......
......@@ -289,7 +289,8 @@ void initPakabeiOperations(CommandLineParser *parser)
repo.addConnectionWithOption(APM::IgnoreGroup);
AkabeiOperation refresh(APM::SyncOperationType, APM::UpdateDatabases, "y", "refresh", ki18n("Refresh database"), false);
refresh.addConnectionWithOption(APM::Force);
AkabeiOperation forceRefresh(APM::SyncOperationType, APM::ForceUpdateDatabases, "yy", "force-refresh", ki18n("Force refresh database"), false);
AkabeiOperation sysupgrade(APM::SyncOperationType, APM::UpdateSystem, "u", "sysupgrade", ki18n("Update system"), false);
sysupgrade.addConnectionWithOption(APM::DownloadOnly);
......@@ -338,6 +339,7 @@ void initPakabeiOperations(CommandLineParser *parser)
parser->addOperation(search);
parser->addOperation(repo);
parser->addOperation(refresh);
parser->addOperation(forceRefresh);
parser->addOperation(sysupgrade);
parser->addOperation(upgrade);
parser->addOperation(perform);
......
......@@ -244,7 +244,7 @@ void PakabeiParser::parse()
* Exception: -Sy without args just updates the databases, while
* -Sy with args first updates and then installs the packages
*/
if (!m_freeArgs.isEmpty() && m_operations.contains(APM::UpdateDatabases)) {
if (!m_freeArgs.isEmpty() && (m_operations.contains(APM::UpdateDatabases) || m_operations.contains(APM::ForceUpdateDatabases))) {
m_operations.insert(APM::Install, specialOperations[APM::Install]);
}
......
......@@ -42,6 +42,7 @@ SyncOperation::SyncOperation(QList<APM::OperationName> operations, QHash<APM::Op
, m_operations(operations)
, m_options(options)
, m_args(args)
, forceDbUpdate(false)
{}
SyncOperation::~SyncOperation()
......@@ -55,6 +56,9 @@ void SyncOperation::start()
switch(operation)
{
case APM::ForceUpdateDatabases: {
forceDbUpdate = true;
}
case APM::UpdateDatabases: {
updateDatabases();
break;
......@@ -333,7 +337,7 @@ void SyncOperation::updateNextDatabase()
connect(db, SIGNAL(statusChanged(AkabeiClient::DatabaseHandler::Status)), this, SLOT(databaseStatusChanged(AkabeiClient::DatabaseHandler::Status)), Qt::QueuedConnection);
connect(db, SIGNAL(progress(int)), this, SLOT(databaseProgressChanged(int)), Qt::QueuedConnection);
connect(db, SIGNAL(errorTriggered(Akabei::Error::List)), this, SLOT(databaseErrorTriggered(Akabei::Error::List)), Qt::QueuedConnection);
db->update(m_options.contains(APM::Force));
db->update(forceDbUpdate);
}
void SyncOperation::databaseErrorTriggered(Akabei::Error::List errors)
......
......@@ -55,6 +55,7 @@ private:
QStringList m_args;
QUuid queryId;
ProgressBar m_bar;
bool forceDbUpdate;
signals:
void syncFinished();
......
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