bugs resolution

This commit is contained in:
Daniel Tartavel 2023-10-10 23:14:31 +02:00
parent 1fa3ec00bc
commit cf0216e02a
4 changed files with 33 additions and 10 deletions

View File

@ -61,13 +61,12 @@ void MainWindow::download()
param << "-aXP"; param << "-aXP";
param << this->downloading.server + "::" + this->downloading.service + "/" + this->downloading.path << this->downloading.savePath + "/"; param << this->downloading.server + "::" + this->downloading.service + "/" + this->downloading.path << this->downloading.savePath + "/";
this->downloading.process->start(cmd, param);
connect(this->downloading.process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(downloadFinished(int, QProcess::ExitStatus))); connect(this->downloading.process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(downloadFinished(int, QProcess::ExitStatus)));
//connect(this->downloading.process, SIGNAL(errorOccurred(QProcess::ProcessError error)), this, SLOT(downloadProcessError(QProcess::ProcessError error))); //connect(this->downloading.process, SIGNAL(errorOccurred(QProcess::ProcessError error)), this, SLOT(downloadProcessError(QProcess::ProcessError error)));
//connect(this->downloading.process, SIGNAL(readyReadStandardError()), this, SLOT(downloadProcessStderr())); //connect(this->downloading.process, SIGNAL(readyReadStandardError()), this, SLOT(downloadProcessStderr()));
connect(this->downloading.process, SIGNAL(readyReadStandardOutput()), this, SLOT(readRsyncOutput())); connect(this->downloading.process, SIGNAL(readyReadStandardOutput()), this, SLOT(readRsyncOutput()));
this->downloading.process->start(cmd, param);
} }
void MainWindow::readRsyncOutput() void MainWindow::readRsyncOutput()

View File

@ -311,7 +311,13 @@ void MainWindow::populateList(int item)
int port; int port;
int i; int i;
if (item == -1)
{
server = ui->khistorycombobox->currentText();
}else
{
server = ui->khistorycombobox->itemText(item); server = ui->khistorycombobox->itemText(item);
}
port = ui->portEdit->text().toUInt(); port = ui->portEdit->text().toUInt();
if ((server != this->connexion.server) or (port != this->connexion.port)) if ((server != this->connexion.server) or (port != this->connexion.port))
{ {
@ -493,7 +499,6 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
bool readOk = false; bool readOk = false;
bool passwdOk = false; bool passwdOk = false;
int nChild = 0; int nChild = 0;
bool r;
static uint looping; static uint looping;
QStringList dirs; QStringList dirs;
@ -541,7 +546,7 @@ bool MainWindow::scanDir(QString server, int portN, QTreeWidgetItem *parent, QSt
if (line.contains("auth failed")) if (line.contains("auth failed"))
{ {
myProcess->readAllStandardOutput(); myProcess->readAllStandardOutput();
r = getUserPassword(&this->connexion); getUserPassword(&this->connexion);
if (looping <= 1) if (looping <= 1)
{ {
this->rescan = true; this->rescan = true;
@ -882,6 +887,12 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
QMessageBox::StandardButton reply; QMessageBox::StandardButton reply;
int sizeFromRsync; int sizeFromRsync;
if (treeviewClicked == true)
{
return;
}
treeviewClicked = true;
itemR = item; itemR = item;
this->rescan = true; this->rescan = true;
@ -906,7 +917,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
// saving path do not exists, asking for it // saving path do not exists, asking for it
if(!on_DefaultSaveFolder_triggered()) if(!on_DefaultSaveFolder_triggered())
{ {
cout << "no directory selectioned, ignoring download request"; cout << "no directory selectioned, ignoring download request" << endl;
return; return;
} }
}else }else
@ -985,11 +996,14 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
}else }else
{ {
//Item is a Directory //Item is a Directory
if (item->isExpanded() == false)
{
while (this->rescan) while (this->rescan)
{ {
scanDir(this->connexion.server, this->connexion.port, item, this->connexion.service + "/" + path +"/"); scanDir(this->connexion.server, this->connexion.port, item, this->connexion.service + "/" + path +"/");
item->setExpanded(true); item->setExpanded(true);
}
} }
} }
@ -997,6 +1011,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
{ {
saveDownloadList(); saveDownloadList();
} }
treeviewClicked = false;
} }
// Launch the thread which download the file // Launch the thread which download the file
@ -1414,3 +1429,9 @@ void MainWindow::on_actionHiddenService_triggered()
} }
} }
void MainWindow::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{
cout << "double-clicked" << endl;
}

View File

@ -119,6 +119,7 @@ class MainWindow : public QMainWindow
QString icon = "/usr/share/icons/RsyncUI.png"; QString icon = "/usr/share/icons/RsyncUI.png";
bool rescan = false; bool rescan = false;
bool stopDlAsked; bool stopDlAsked;
bool treeviewClicked;
QList<QString> UnitText QList<QString> UnitText
{ {
@ -217,6 +218,8 @@ class MainWindow : public QMainWindow
void on_actionHiddenService_triggered(); void on_actionHiddenService_triggered();
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
signals: signals:
void stopDownloading(QProcess *); void stopDownloading(QProcess *);
void progressSignal(int); void progressSignal(int);

View File

@ -3,6 +3,6 @@
#include <QString> #include <QString>
QString version = "2.11.5"; QString version = "2.11.8";
#endif // VERSION_H #endif // VERSION_H