@@ -118,8 +118,6 @@ void MainWindow::setup()
118
118
ui->tabWidget ->setTabVisible (Tab::Flatpak, arch != " i386" );
119
119
ui->tabWidget ->setTabVisible (Tab::Test, QFile::exists (" /etc/apt/sources.list.d/mx.list" ));
120
120
121
- lock_file = new LockFile (" /var/lib/dpkg/lock" );
122
-
123
121
test_initially_enabled
124
122
= cmd.run (" apt-get update --print-uris | grep -m1 -qE '/mx/testrepo/dists/" + ver_name + " /test/'" );
125
123
@@ -181,15 +179,15 @@ bool MainWindow::uninstall(const QString &names, const QString &preuninstall, co
181
179
qDebug () << " Pre-uninstall" ;
182
180
ui->tabWidget ->setTabText (ui->tabWidget ->indexOf (ui->tabOutput ), tr (" Running pre-uninstall operations..." ));
183
181
enableOutput ();
184
- if (lock_file-> isLockedGUI ()) {
182
+ if (lock_file. isLockedGUI ()) {
185
183
return false ;
186
184
}
187
185
success = cmd.runAsRoot (preuninstall);
188
186
}
189
187
190
188
if (success) {
191
189
enableOutput ();
192
- if (lock_file-> isLockedGUI ()) {
190
+ if (lock_file. isLockedGUI ()) {
193
191
return false ;
194
192
}
195
193
success = cmd.runAsRoot (" DEBIAN_FRONTEND=$(dpkg -l debconf-kde-helper 2>/dev/null | grep -sq ^i "
@@ -201,7 +199,7 @@ bool MainWindow::uninstall(const QString &names, const QString &preuninstall, co
201
199
qDebug () << " Post-uninstall" ;
202
200
ui->tabWidget ->setTabText (ui->tabWidget ->indexOf (ui->tabOutput ), tr (" Running post-uninstall operations..." ));
203
201
enableOutput ();
204
- if (lock_file-> isLockedGUI ()) {
202
+ if (lock_file. isLockedGUI ()) {
205
203
return false ;
206
204
}
207
205
success = cmd.runAsRoot (postuninstall);
@@ -212,7 +210,7 @@ bool MainWindow::uninstall(const QString &names, const QString &preuninstall, co
212
210
bool MainWindow::updateApt ()
213
211
{
214
212
qDebug () << " +++" << __PRETTY_FUNCTION__ << " +++" ;
215
- if (lock_file-> isLockedGUI ()) {
213
+ if (lock_file. isLockedGUI ()) {
216
214
return false ;
217
215
}
218
216
ui->tabOutput ->isVisible () // Don't display in output if calling to refresh from tabs
@@ -1160,7 +1158,7 @@ bool MainWindow::install(const QString &names)
1160
1158
" DEBIAN_FRONTEND=$(dpkg -l debconf-kde-helper 2>/dev/null | grep -sq ^i && echo kde || echo gnome) " };
1161
1159
QString aptget {" apt-get -o=Dpkg::Use-Pty=0 install -y " };
1162
1160
1163
- if (lock_file-> isLockedGUI ()) {
1161
+ if (lock_file. isLockedGUI ()) {
1164
1162
return false ;
1165
1163
}
1166
1164
QString recommends;
@@ -1204,7 +1202,7 @@ bool MainWindow::installBatch(const QStringList &name_list)
1204
1202
if (postinstall != ' \n ' ) {
1205
1203
qDebug () << " Post-install" ;
1206
1204
ui->tabWidget ->setTabText (ui->tabWidget ->indexOf (ui->tabOutput ), tr (" Post-processing..." ));
1207
- if (lock_file-> isLockedGUI ()) {
1205
+ if (lock_file. isLockedGUI ()) {
1208
1206
return false ;
1209
1207
}
1210
1208
enableOutput ();
@@ -1236,7 +1234,7 @@ bool MainWindow::installPopularApp(const QString &name)
1236
1234
if (!preinstall.isEmpty ()) {
1237
1235
qDebug () << " Pre-install" ;
1238
1236
ui->tabWidget ->setTabText (ui->tabWidget ->indexOf (ui->tabOutput ), tr (" Pre-processing for " ) + name);
1239
- if (lock_file-> isLockedGUI ()) {
1237
+ if (lock_file. isLockedGUI ()) {
1240
1238
return false ;
1241
1239
}
1242
1240
if (!cmd.runAsRoot (preinstall)) {
@@ -1258,7 +1256,7 @@ bool MainWindow::installPopularApp(const QString &name)
1258
1256
if (!postinstall.isEmpty ()) {
1259
1257
qDebug () << " Post-install" ;
1260
1258
ui->tabWidget ->setTabText (ui->tabWidget ->indexOf (ui->tabOutput ), tr (" Post-processing for " ) + name);
1261
- if (lock_file-> isLockedGUI ()) {
1259
+ if (lock_file. isLockedGUI ()) {
1262
1260
return false ;
1263
1261
}
1264
1262
cmd.runAsRoot (postinstall);
0 commit comments