Skip to content

Commit

Permalink
Add delay funtion for give time to Qprocess finished
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksis committed Dec 12, 2020
1 parent 9e750ce commit e33e3a0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
v0.10.2

+ Se agregó una función para hacer un "delay" que de tiempo a que termine el Qprocess:

void MainWindow::delay(int delaytime)


v.0.10.1

* Refactoring MainWindow::ExistsProgram using waitForStarted/Finished(TIMEOUT)


v0.10.0

+ Check picta-dl and ffmpeg to the PATH environment variable


v0.9.0

+ Ahora puede resumir las descargas en caso que la haya detenido o no se pudo completar anteriormente.
Expand Down
7 changes: 7 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1252,3 +1252,10 @@ bool MainWindow::ExistsProgram(QString program)
prog.waitForFinished(TIMEOUT);
return true;
}

void MainWindow::delay(int delaytime)
{
QTime dieTime= QTime::currentTime().addSecs(delaytime);
while (QTime::currentTime() < dieTime)
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
2 changes: 2 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <QSystemTrayIcon>
#include <QAction>
#include <QCloseEvent>
#include <QTime>
#include "configuration.h"
#include "simplecrypt.h"
#include "information.h"
Expand Down Expand Up @@ -148,6 +149,7 @@ private slots:
void ShowErrorMessage(QString Title, QString Error);
bool IsNetworkConnected();
bool ExistsProgram(QString program);
void delay(int delaytime = 1);

void createActions();
void createTrayIcon();
Expand Down

0 comments on commit e33e3a0

Please sign in to comment.