Skip to content

Commit

Permalink
[Qt] Fix Qt4 (?) + change update url scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
mean committed Sep 4, 2016
1 parent 2c2fb4f commit 7fee121
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
15 changes: 7 additions & 8 deletions avidemux/qt4/ADM_update/private_inc/ADM_updateImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#include <QNetworkReply>
#include <QThread>

#if 1
#if 0
#define ADM_UPDATE_SERVER "http://192.168.0.9/"
#else
#define ADM_UPDATE_SERVER "http://avidemux.org/updates/"
#define ADM_UPDATE_SERVER "http://www.avidemux.org/update/"
#endif

// Helper defines to construct URL
Expand All @@ -38,7 +38,7 @@
#else
#ifdef __linux__
#define ADM_UPDATE_MACHINE "Linux"
#else
#else
#define ADM_UPDATE_MACHINE "???"
#endif
#endif // apple
Expand All @@ -55,12 +55,11 @@ class ADMCheckUpdate: public QObject
public:
ADMCheckUpdate(ADM_updateComplete *up);
virtual ~ADMCheckUpdate();
protected:
QNetworkAccessManager manager;
protected:
QNetworkAccessManager manager;
ADM_updateComplete *_updateCallback;

public slots:
void execute();
void downloadFinished(QNetworkReply *reply);
void downloadFinished(QNetworkReply *reply);
};

11 changes: 8 additions & 3 deletions avidemux/qt4/ADM_update/src/ADM_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "ADM_updateImpl.h"
#include "QTimer"
#include "ADM_default.h"
using namespace std;
#include "ADM_string.h"
/**
*/
Expand Down Expand Up @@ -47,13 +46,19 @@ void ADMCheckUpdate::execute()
void ADMCheckUpdate::downloadFinished(QNetworkReply *reply)
{
ADM_info("Download finished\n");
QString st;
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
st=reply->url().toDisplayString().toUtf8();
#else
st=reply->url().toString().toUtf8();
#endif
if(reply->error())
{
ADM_warning("Error downloading update %s\n",reply->url().toDisplayString().toUtf8().constData());
ADM_warning("Error downloading update %s\n",st.toUtf8().constData());
ADM_warning("Er=%s\n",reply->errorString().toUtf8().constData());
return;
}
ADM_warning("Success downloading update %s\n",reply->url().toDisplayString().toUtf8().constData());
ADM_warning("Success downloading update %s\n",st.toUtf8().constData());
QByteArray ba=reply->readAll();
if(!ba.size())
return;
Expand Down
9 changes: 4 additions & 5 deletions avidemux_core/ADM_coreUtils/include/ADM_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
* (at your option) any later version. *
***************************************************************************/

#ifndef ADM_STRING_H
#define ADM_STRING_H

#pragma once
#include <string>
#include <vector>
#include "ADM_coreUtils6_export.h"
#include "ADM_image.h"

ADM_COREUTILS6_EXPORT bool ADM_splitString(const string &separator, const string &source, vector<string>& result);
#endif
ADM_COREUTILS6_EXPORT bool ADM_splitString(const std::string &separator, const std::string &source, std::vector<std::string>& result);
//EOF

0 comments on commit 7fee121

Please sign in to comment.