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

-Syy implemented

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