diff --git a/src/dialogs/choosefiledialog.h b/src/dialogs/choosefiledialog.h --- a/src/dialogs/choosefiledialog.h +++ b/src/dialogs/choosefiledialog.h @@ -1,6 +1,7 @@ /* Atelier KDE Printer Host for 3D Printing Copyright (C) <2017> Author: Lays Rodrigues - laysrodriguessilva@gmail.com + Chris Rizzitello - rizzitello@kde.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +28,7 @@ public: ChooseFileDialog(QWidget *parent=nullptr, QList files = QList()); virtual ~ChooseFileDialog() {} - const QString& choosenFile(); + const QUrl choosenFile(); private: - QString m_choosen_file; + QUrl m_choosen_file; }; diff --git a/src/dialogs/choosefiledialog.cpp b/src/dialogs/choosefiledialog.cpp --- a/src/dialogs/choosefiledialog.cpp +++ b/src/dialogs/choosefiledialog.cpp @@ -1,7 +1,7 @@ /* Atelier KDE Printer Host for 3D Printing Copyright (C) <2017> Author: Lays Rodrigues - laysrodriguessilva@gmail.com - + Chris Rizzitello - rizzitello@kde.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or @@ -35,8 +35,8 @@ files_list.append(file.toLocalFile()); } listWigdet->addItems(files_list); - connect(listWigdet, &QListWidget::currentTextChanged, [ this ](const QString& t){ - m_choosen_file = t; + connect(listWigdet, &QListWidget::currentRowChanged, [ this, &files ](const int t){ + m_choosen_file = files.at(t); }); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); connect(buttonBox, &QDialogButtonBox::accepted, this, &ChooseFileDialog::accept); @@ -47,7 +47,7 @@ setLayout(layout); } -const QString& ChooseFileDialog::choosenFile() +const QUrl ChooseFileDialog::choosenFile() { return m_choosen_file; }