Simplify code to open downloaded files
This commit is contained in:
parent
8e85aead26
commit
679a04bee6
@ -112,17 +112,8 @@ void Downloader::startDownload (const QUrl& url) {
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
void Downloader::openDownload() {
|
void Downloader::openDownload() {
|
||||||
if (!m_filePath.isEmpty()) {
|
if (!m_filePath.isEmpty())
|
||||||
QString url = m_filePath;
|
QDesktopServices::openUrl (QUrl::fromLocalFile (m_filePath));
|
||||||
|
|
||||||
if (url.startsWith ("/"))
|
|
||||||
url = "file://" + url;
|
|
||||||
else
|
|
||||||
url = "file:///" + url;
|
|
||||||
|
|
||||||
hide();
|
|
||||||
QDesktopServices::openUrl (url);
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
else {
|
||||||
QMessageBox::critical (this,
|
QMessageBox::critical (this,
|
||||||
|
BIN
tutorial/download/YesItWorks.jpg
Normal file
BIN
tutorial/download/YesItWorks.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
@ -27,6 +27,9 @@ Window::Window (QWidget* parent) : QMainWindow (parent) {
|
|||||||
m_ui = new Ui::Window;
|
m_ui = new Ui::Window;
|
||||||
m_ui->setupUi (this);
|
m_ui->setupUi (this);
|
||||||
|
|
||||||
|
setWindowTitle (qApp->applicationName());
|
||||||
|
|
||||||
|
/* QSimpleUpdater is single-instance */
|
||||||
m_updater = QSimpleUpdater::getInstance();
|
m_updater = QSimpleUpdater::getInstance();
|
||||||
|
|
||||||
/* Check for updates when the "Check For Updates" button is clicked */
|
/* Check for updates when the "Check For Updates" button is clicked */
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
int main (int argc, char** argv) {
|
int main (int argc, char** argv) {
|
||||||
QApplication app (argc, argv);
|
QApplication app (argc, argv);
|
||||||
app.setApplicationVersion ("1.0");
|
app.setApplicationVersion ("1.0");
|
||||||
app.setApplicationName ("Application");
|
app.setApplicationName ("Bob's Badass App");
|
||||||
|
|
||||||
Window window;
|
Window window;
|
||||||
window.show();
|
window.show();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user