Commit 135f668b authored by Dennis Rassmann's avatar Dennis Rassmann

flasher: fix unintended iteration of files

Signed-off-by: Dennis Rassmann's avatarshowp1984 <showp1984@gmail.com>
parent 8a3a6493
......@@ -537,17 +537,19 @@ void PushWorker::run(void)
{
QProcess p2;
QDirIterator it2(QString(abstemppath), QDirIterator::Subdirectories);
QString filepath2;
while (it2.hasNext()) {
if (it2.next().contains(".ko") && !it2.next().isEmpty()) {
filepath2 = it2.next();
if (filepath2 .contains(".ko") && !filepath2 .isEmpty()) {
p2.terminate();
#ifdef Q_WS_X11
p2.start( "tools/adb -s " + snr + " push " + it2.next() + " /system/lib/modules/");
p2.start( "tools/adb -s " + snr + " push " + filepath2 + " /system/lib/modules/");
#endif
#ifdef Q_WS_MAC
p2.start( "tools/adb-mac -s " + snr + " push " + it2.next() + " /system/lib/modules/");
p2.start( "tools/adb-mac -s " + snr + " push " + filepath2 + " /system/lib/modules/");
#endif
#ifdef Q_WS_WIN
p2.start( "tools\\adb.exe -s " + snr + " push " + it2.next() + " /system/lib/modules/");
p2.start( "tools\\adb.exe -s " + snr + " push " + filepath2 + " /system/lib/modules/");
#endif
p2.waitForFinished(-1);
}
......@@ -617,20 +619,23 @@ int flasher::flash_boot(void)
if (!snr.isEmpty() && !state.isEmpty()) {
flashtimer->setInterval(1000);
ui->txt_out->append("Flashing boot.img...");
QDirIterator it(QString(qApp->applicationDirPath() + "/" + tmp_folder), QDirIterator::Subdirectories);
QString filepath;
while (it.hasNext()) {
if (it.next().contains("boot.img") && !it.next().isEmpty()) {
qDebug() << it.next();
filepath = it.next();
if (filepath.contains("boot.img") && !filepath.isEmpty()) {
qDebug() << filepath;
p.terminate();
p_out = "";
#ifdef Q_WS_X11
p.start( "tools/fastboot -p " + device + " flash boot " + "\"" + it.next() + "\"");
p.start( "tools/fastboot -p " + device + " flash boot " + "\"" + filepath + "\"");
#endif
#ifdef Q_WS_MAC
p.start( "tools/fastboot-mac -p " + device + " flash boot " + "\"" + it.next() + "\"");
p.start( "tools/fastboot-mac -p " + device + " flash boot " + "\"" + filepath + "\"");
#endif
#ifdef Q_WS_WIN
p.start( "tools\\fastboot.exe -p " + device + " flash boot " + "\"" + it.next() + "\"");
p.start( "tools\\fastboot.exe -p " + device + " flash boot " + "\"" + filepath + "\"");
#endif
p.waitForFinished(-1);
p_out = p.readAllStandardOutput();
......
......@@ -130,7 +130,7 @@ p, li { white-space: pre-wrap; }
</rect>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
......@@ -146,7 +146,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<set>Qt::TextSelectableByMouse</set>
</property>
</widget>
<widget class="QLabel" name="lbl_filepath">
......
/********************************************************************************
** Form generated from reading UI file 'flasher.ui'
**
** Created: Mon Jul 2 10:56:24 2012
** Created: Mon Jul 2 12:51:06 2012
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
......@@ -86,10 +86,10 @@ public:
txt_out = new QTextEdit(centralwidget);
txt_out->setObjectName(QString::fromUtf8("txt_out"));
txt_out->setGeometry(QRect(200, 60, 521, 371));
txt_out->setContextMenuPolicy(Qt::NoContextMenu);
txt_out->setContextMenuPolicy(Qt::DefaultContextMenu);
txt_out->setUndoRedoEnabled(false);
txt_out->setReadOnly(true);
txt_out->setTextInteractionFlags(Qt::NoTextInteraction);
txt_out->setTextInteractionFlags(Qt::TextSelectableByMouse);
lbl_filepath = new QLabel(centralwidget);
lbl_filepath->setObjectName(QString::fromUtf8("lbl_filepath"));
lbl_filepath->setGeometry(QRect(200, 30, 41, 25));
......
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