Commit 4bae8a2e authored by LordTermor's avatar LordTermor

Fixed transaction run

parent c45610f5
......@@ -174,10 +174,15 @@ Pane {
enabled: !(transaction.started || (transaction.details.length!=0 && totalPending==0))
text:qsTr("Apply")
onClicked: {
let success = false;
if(!sysUpgrade)
transaction.start(toInstall,toRemove,toLoad,toBuild,[],[]);
success = transaction.run(toInstall,toRemove,toLoad,toBuild,[],[]);
else
transaction.startSysupgrade(true,false,ignoreWhenUpdate,[]);
success = transaction.runSysupgrade(true);
if (success){
mainWindow.clear();
}
}
}
......
......@@ -13,8 +13,8 @@ StackView {
Connections{
target: transaction
onFinished:{
if(success)
onStartedChanged:{
if(!started)
drawerStack.currentItem.StackView.activating();
}
}
......
......@@ -47,11 +47,6 @@ ApplicationWindow {
}
}
onFinished:{
if(success){
clear();
}
}
Component.onDestruction: {
transaction.quitDaemon();
}
......@@ -73,10 +68,9 @@ ApplicationWindow {
return objects["ok"];
}
requestCommit: summary=>{
// let objects = {"summary":summary,"result":undefined}
// objects = DialogRunner.exec(Qt.resolvedUrl("../Dialogs/TransactionSummaryDialog.qml"),objects);
// return objects["result"]
return true
let objects = {"summary":summary,"result":undefined}
objects = DialogRunner.exec(Qt.resolvedUrl("../Dialogs/TransactionSummaryDialog.qml"),objects);
return objects["result"]
}
}
......
......@@ -83,10 +83,10 @@ public:
pamac_transaction_quit_daemon(m_handle);
}
Q_INVOKABLE void start(const QStringList& toInstall = QStringList(), const QStringList& toRemove = QStringList(), const QStringList& toLoad = QStringList(),
Q_INVOKABLE bool run(const QStringList& toInstall = QStringList(), const QStringList& toRemove = QStringList(), const QStringList& toLoad = QStringList(),
const QStringList& toBuild = QStringList(), const QStringList& tempIgnore = QStringList(), const QStringList& overwriteFiles = QStringList());
Q_INVOKABLE void startSysupgrade(bool forceRefresh,bool enableDowngrade,const QStringList& tempIgnore = QStringList(),const QStringList& overwriteFiles = QStringList());
Q_INVOKABLE bool runSysupgrade(bool forceRefresh);
public Q_SLOTS:
......
......@@ -74,10 +74,9 @@ GenericQmlFuture LibQPamac::Transaction::getBuildFiles(const QString &pkgname){
}
void LibQPamac::Transaction::start(const QStringList& toInstall, const QStringList& toRemove, const QStringList& toLoad,
bool LibQPamac::Transaction::run(const QStringList& toInstall, const QStringList& toRemove, const QStringList& toLoad,
const QStringList& toBuild, const QStringList& tempIgnore, const QStringList& overwriteFiles)
{
using Utils::qStringListToCStringVector;
for(auto& name : toInstall){
pamac_transaction_add_pkg_to_install(m_handle,name.toUtf8());
......@@ -102,28 +101,23 @@ void LibQPamac::Transaction::start(const QStringList& toInstall, const QStringLi
for(auto& name : overwriteFiles){
pamac_transaction_add_overwrite_file(m_handle,name.toUtf8());
}
setProperty("started",true);
pamac_transaction_run(m_handle);
setProperty("started",true);
auto result = bool(pamac_transaction_run(m_handle));
this->setProperty("progress",0);
this->setProperty("started",false);
return result;
}
void LibQPamac::Transaction::startSysupgrade(bool forceRefresh, bool enableDowngrade, const QStringList &tempIgnore, const QStringList &overwriteFiles)
bool LibQPamac::Transaction::runSysupgrade(bool forceRefresh)
{
pamac_transaction_add_pkgs_to_upgrade(m_handle,forceRefresh);
for(auto& name : tempIgnore){
pamac_transaction_add_temporary_ignore_pkg(m_handle,name.toUtf8());
}
setProperty("started",true);
auto result = bool(pamac_transaction_run(m_handle));
for(auto& name : overwriteFiles){
pamac_transaction_add_overwrite_file(m_handle,name.toUtf8());
}
setProperty("started",true);
pamac_transaction_run(m_handle);
this->setProperty("progress",0);
this->setProperty("started",false);
return result;
}
void LibQPamac::Transaction::setDatabase(LibQPamac::Database *database)
......
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