From: Norbert Moutarde Date: Sat, 21 Jun 2014 10:40:20 +0000 (+0200) Subject: I've added root ability (if term rooted, of course) X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=485e9a5ed3590a72e3ee841761f00af5fbf7d4c9;p=diary-mobile.git I've added root ability (if term rooted, of course) --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 17cc6cb..2ab28f7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -350,7 +350,7 @@ void MainWindow::action(const QString &a){ if(bs==2){ QFile a(b[1]); a.open(QIODevice::ReadOnly); - read(QString("buttons"),a.readAll()); + read(conf->value(QString("currenttype")).toString(),a.readAll()); }else{ QMessageBox::warning(this, trUtf8("Error", "title of box if action(\"read\" has too much (or too \"less\") value"), trUtf8("Bad number of value", "text of box if action(\"read\") has too much (or too \"less\") value")); } @@ -366,6 +366,11 @@ void MainWindow::action(const QString &a){ else if(b[0]==QString("use")){ use(c); } + else if(b[0]==QString("sup")){ + system("su"); + action(c); + system("exit"); + } else { get(conf->value(QString("currenttype")).toString(),a); @@ -631,7 +636,7 @@ void MainWindow::chooseDB(){ bool ok=1; if(conf->value("askkeyword").toBool())b=QInputDialog::getText(this, trUtf8("chooseDB"), trUtf8("Enter the keyword : "), QLineEdit::Normal, label->text(), &ok); else b=label->text(); - if(ok)chooseDB(QString("buttons"), b); + if(ok)chooseDB(conf->value(QString("currenttype")).toString(), b); } void MainWindow::chooseDB(const QString & b){ flush(); @@ -717,7 +722,7 @@ void MainWindow::RAWsent(){ void MainWindow::back(){ if(!((video)&&(playlist))){ get(conf->value(QString("currenttype")).toString(),conf->value(QString("menuback")).toString()); - }else if(QString("-")+label->text()==conf->value(QString("menuback")).toString())get(QString("buttons"),way.takeLast()); + }else if(QString("-")+label->text()==conf->value(QString("menuback")).toString())get(conf->value(QString("currenttype")).toString(),way.takeLast()); else{ get(conf->value(QString("currenttype")).toString(), QString("+video")); } @@ -976,7 +981,7 @@ void MainWindow::tmpdown(){ connect(m, SIGNAL(downloaded()), this, SLOT(readData())); } void MainWindow::readData(){ - read(QString("buttons"), m->downloadedData()); + read(conf->value(QString("currenttype")).toString(), m->downloadedData()); m->disconnect(m, SIGNAL(downloaded()),this, SLOT(readData())); } void MainWindow::action(){