[X2Go-Commits] [x2goclient] 01/04: misc {src/, x2goclient.pro}: port to Qt5.
git-admin at x2go.org
git-admin at x2go.org
Tue Apr 5 06:15:32 CEST 2016
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2goclient.
commit c28a95b0157160acd480df115c1ff2ec0c672300
Author: Sébastien Ducoulombier <seb at ldd.fr>
Date: Sat Apr 2 05:56:49 2016 +0200
misc {src/,x2goclient.pro}: port to Qt5.
---
debian/changelog | 5 +++++
src/SVGFrame.cpp | 4 ++--
src/SVGFrame.h | 4 ++--
src/configdialog.cpp | 2 +-
src/configdialog.h | 2 +-
src/cupsprint.cpp | 30 +++++++++++++++---------------
src/cupsprintersettingsdialog.cpp | 2 +-
src/cupsprintersettingsdialog.h | 2 +-
src/editconnectiondialog.cpp | 2 +-
src/editconnectiondialog.h | 2 +-
src/exportdialog.cpp | 2 +-
src/exportdialog.h | 2 +-
src/httpbrokerclient.cpp | 24 ++++++++++++++++++++++++
src/imgframe.cpp | 2 +-
src/imgframe.h | 2 +-
src/ongetpass.cpp | 4 ++++
src/onmainwindow.cpp | 34 +++++++++++++++++-----------------
src/onmainwindow_privat.h | 7 ++++++-
src/sessionbutton.cpp | 4 ++--
src/sessionexplorer.cpp | 5 +++++
src/sessionmanagedialog.cpp | 2 +-
src/sessionmanagedialog.h | 2 +-
src/sshmasterconnection.cpp | 34 +++++++++++++++++-----------------
x2goclient.pro | 1 +
24 files changed, 112 insertions(+), 68 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index cc27a9b..d23299a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,11 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium
* New upstream version (4.0.5.2):
- res/i18n/x2goclient_fi.ts: update Finnish translation file.
+
+ [ Sébastien Ducoulombier ]
+ * New upstream version (4.0.5.2):
+ - misc {src/,x2goclient.pro}: port to Qt5.
+
-- X2Go Release Manager <git-admin at x2go.org> Thu, 24 Mar 2016 23:04:42 +0100
x2goclient (4.0.5.1-0x2go1) unstable; urgency=low
diff --git a/src/SVGFrame.cpp b/src/SVGFrame.cpp
index cb17930..268b037 100644
--- a/src/SVGFrame.cpp
+++ b/src/SVGFrame.cpp
@@ -26,7 +26,7 @@
SVGFrame::SVGFrame ( QString fname,bool st,QWidget* parent,
- Qt::WFlags f ) :QFrame ( parent,f )
+ Qt::WindowFlags f ) :QFrame ( parent,f )
{
empty=false;
#ifdef Q_OS_WIN
@@ -66,7 +66,7 @@ SVGFrame::SVGFrame ( QString fname,bool st,QWidget* parent,
}
SVGFrame::SVGFrame ( QWidget* parent,
- Qt::WFlags f ) :QFrame ( parent,f )
+ Qt::WindowFlags f ) :QFrame ( parent,f )
{
repaint=false;
empty=true;
diff --git a/src/SVGFrame.h b/src/SVGFrame.h
index 1c6fe18..f9d9998 100644
--- a/src/SVGFrame.h
+++ b/src/SVGFrame.h
@@ -28,8 +28,8 @@ class SVGFrame: public QFrame
Q_OBJECT
public:
- SVGFrame ( QString fname, bool st, QWidget* parent=0, Qt::WFlags f=0 );
- SVGFrame ( QWidget* parent=0, Qt::WFlags f=0 );
+ SVGFrame ( QString fname, bool st, QWidget* parent=0, Qt::WindowFlags f=0 );
+ SVGFrame ( QWidget* parent=0, Qt::WindowFlags f=0 );
void setRepaintable ( bool val )
{
repaint=val;
diff --git a/src/configdialog.cpp b/src/configdialog.cpp
index 99cb7ef..2f70a13 100644
--- a/src/configdialog.cpp
+++ b/src/configdialog.cpp
@@ -46,7 +46,7 @@
#endif
-ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WFlags f )
+ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WindowFlags f )
: QDialog ( parent,f )
{
diff --git a/src/configdialog.h b/src/configdialog.h
index 717f709..e9b6582 100644
--- a/src/configdialog.h
+++ b/src/configdialog.h
@@ -44,7 +44,7 @@ class ConfigDialog : public QDialog
Q_OBJECT
public:
ConfigDialog ( QWidget * parent,
- Qt::WFlags f = 0 );
+ Qt::WindowFlags f = 0 );
~ConfigDialog();
#ifdef Q_OS_DARWIN
static QString findXDarwin ( QString& version,
diff --git a/src/cupsprint.cpp b/src/cupsprint.cpp
index 0354bfc..af9adf0 100644
--- a/src/cupsprint.cpp
+++ b/src/cupsprint.cpp
@@ -53,7 +53,7 @@ QString CUPSPrint::getDefaultUserPrinter()
"CUPS/defaultprinter","" ). toString();
if ( defPrint.length() >0 )
{
- cups_dest_t *dest = cupsGetDest ( defPrint.toAscii(),
+ cups_dest_t *dest = cupsGetDest ( defPrint.toLatin1(),
0l, num_dests, dests );
if ( dest )
return defPrint;
@@ -77,7 +77,7 @@ bool CUPSPrint::getPrinterInfo ( const QString& printerName, QString& info,
QString& model, printState& state,
QString& stateReason )
{
- cups_dest_t *dest = cupsGetDest ( printerName.toAscii(), 0l,
+ cups_dest_t *dest = cupsGetDest ( printerName.toLatin1(), 0l,
num_dests,
dests );
if ( !dest )
@@ -114,15 +114,15 @@ bool CUPSPrint::getPrinterInfo ( const QString& printerName, QString& info,
bool CUPSPrint::setCurrentPrinter ( QString prn )
{
currentPrinter=prn;
- QString fl=cupsGetPPD ( prn.toAscii() );
+ QString fl=cupsGetPPD ( prn.toLatin1() );
if ( fl.length() <=0 )
return false;
if ( ppd )
ppdClose ( ppd );
ppd=0l;
- ppd=ppdOpenFile ( fl.toAscii() );
- unlink ( fl.toAscii() );
+ ppd=ppdOpenFile ( fl.toLatin1() );
+ unlink ( fl.toLatin1() );
if ( ppd==0l )
return false;
ppdMarkDefaults ( ppd );
@@ -141,10 +141,10 @@ bool CUPSPrint::getOptionValue ( const QString& option,
{
if ( !ppd )
return false;
- ppd_choice_t* choice=ppdFindMarkedChoice ( ppd,option.toAscii() );
+ ppd_choice_t* choice=ppdFindMarkedChoice ( ppd,option.toLatin1() );
if ( !choice )
{
- ppd_option_t* opt=ppdFindOption ( ppd,option.toAscii() );
+ ppd_option_t* opt=ppdFindOption ( ppd,option.toLatin1() );
if ( !opt )
return false;
choice=ppdFindChoice ( opt,opt->defchoice );
@@ -168,7 +168,7 @@ int CUPSPrint::getOptionValues ( const QString& option,
int cur_val=-1;
values.clear();
descriptions.clear();
- ppd_option_t* opt=ppdFindOption ( ppd,option.toAscii() );
+ ppd_option_t* opt=ppdFindOption ( ppd,option.toLatin1() );
if ( !opt )
return -1;
for ( int k=0;k<opt->num_choices;++k )
@@ -241,7 +241,7 @@ bool CUPSPrint::setValue ( const QString& option, const QString& value,
QString valueBefore, textBefore;
if ( !getOptionValue ( option,valueBefore,textBefore ) )
return false;
- ppdMarkOption ( ppd,option.toAscii(),value.toAscii() );
+ ppdMarkOption ( ppd,option.toLatin1(),value.toLatin1() );
if ( conflictsBefore==ppdConflicts ( ppd ) )
{
@@ -281,7 +281,7 @@ bool CUPSPrint::setValue ( const QString& option, const QString& value,
//set previous value
- ppdMarkOption ( ppd,option.toAscii(),valueBefore.toAscii() );
+ ppdMarkOption ( ppd,option.toLatin1(),valueBefore.toLatin1() );
return false;
}
@@ -290,7 +290,7 @@ bool CUPSPrint::getOptionText ( const QString& option, QString& text )
{
if ( !ppd )
return false;
- ppd_option_t* opt=ppdFindOption ( ppd,option .toAscii() );
+ ppd_option_t* opt=ppdFindOption ( ppd,option.toLatin1() );
if ( !opt )
return false;
text=QString::fromLocal8Bit ( opt->text );
@@ -355,7 +355,7 @@ void CUPSPrint::loadUserOptions()
for ( int i=0;i<options.size();++i )
{
QStringList opt=options[i].split ( "=" );
- ppdMarkOption ( ppd,opt[0].toAscii(),opt[1].toAscii() );
+ ppdMarkOption ( ppd,opt[0].toLatin1(),opt[1].toLatin1() );
}
}
@@ -381,14 +381,14 @@ void CUPSPrint::print ( const QString& file, QString title )
if ( val!=option->defchoice )
{
num_options = cupsAddOption ( option->keyword,
- val.toAscii(),
+ val.toLatin1(),
num_options,
&options );
}
}
}
- cupsPrintFile ( currentPrinter.toAscii(),file.toAscii(),
- title.toAscii(), num_options,options );
+ cupsPrintFile ( currentPrinter.toLatin1(),file.toLatin1(),
+ title.toLatin1(), num_options,options );
cupsFreeOptions ( num_options, options );
}
#endif
diff --git a/src/cupsprintersettingsdialog.cpp b/src/cupsprintersettingsdialog.cpp
index 6219567..9874f2f 100644
--- a/src/cupsprintersettingsdialog.cpp
+++ b/src/cupsprintersettingsdialog.cpp
@@ -27,7 +27,7 @@ CUPSPrinterSettingsDialog::CUPSPrinterSettingsDialog (
QString prnName,
CUPSPrint* cupsObject,
QWidget * parent,
- Qt::WFlags flags
+ Qt::WindowFlags flags
) :QDialog ( parent, flags )
{
m_cups=cupsObject;
diff --git a/src/cupsprintersettingsdialog.h b/src/cupsprintersettingsdialog.h
index 2b676c9..14fbe07 100644
--- a/src/cupsprintersettingsdialog.h
+++ b/src/cupsprintersettingsdialog.h
@@ -34,7 +34,7 @@ class CUPSPrinterSettingsDialog : public QDialog
CUPSPrinterSettingsDialog ( QString prnName,
CUPSPrint* cupsObject,
QWidget * parent=0l,
- Qt::WFlags flags =0 );
+ Qt::WindowFlags flags =0 );
~CUPSPrinterSettingsDialog();
private:
CUPSPrint* m_cups;
diff --git a/src/editconnectiondialog.cpp b/src/editconnectiondialog.cpp
index 6301def..1a1f513 100644
--- a/src/editconnectiondialog.cpp
+++ b/src/editconnectiondialog.cpp
@@ -30,7 +30,7 @@
#include "mediawidget.h"
EditConnectionDialog::EditConnectionDialog ( bool newSession, QString id, QWidget * par,
- int ind,Qt::WFlags f )
+ int ind,Qt::WindowFlags f )
: QDialog ( par,f )
{
QVBoxLayout* ml=new QVBoxLayout ( this );
diff --git a/src/editconnectiondialog.h b/src/editconnectiondialog.h
index 43448fd..ee8f95a 100644
--- a/src/editconnectiondialog.h
+++ b/src/editconnectiondialog.h
@@ -49,7 +49,7 @@ class EditConnectionDialog : public QDialog
Q_OBJECT
public:
EditConnectionDialog ( bool newSession, QString id, QWidget * par, int ind=0,
- Qt::WFlags f = 0 );
+ Qt::WindowFlags f = 0 );
~EditConnectionDialog();
private:
QTabWidget *fr;
diff --git a/src/exportdialog.cpp b/src/exportdialog.cpp
index 5820c23..ad95beb 100644
--- a/src/exportdialog.cpp
+++ b/src/exportdialog.cpp
@@ -32,7 +32,7 @@
#include <QFileDialog>
#include "sessionexplorer.h"
-ExportDialog::ExportDialog ( QString sid,QWidget * par, Qt::WFlags f )
+ExportDialog::ExportDialog ( QString sid,QWidget * par, Qt::WindowFlags f )
: QDialog ( par,f )
{
sessionId=sid;
diff --git a/src/exportdialog.h b/src/exportdialog.h
index 3a9e667..b971fe9 100644
--- a/src/exportdialog.h
+++ b/src/exportdialog.h
@@ -33,7 +33,7 @@ class ExportDialog : public QDialog
{
Q_OBJECT
public:
- ExportDialog(QString sid,QWidget * par, Qt::WFlags f = 0);
+ ExportDialog(QString sid,QWidget * par, Qt::WindowFlags f = 0);
~ExportDialog();
QString getExport(){return directory;}
diff --git a/src/httpbrokerclient.cpp b/src/httpbrokerclient.cpp
index 2a1c43c..4356c93 100644
--- a/src/httpbrokerclient.cpp
+++ b/src/httpbrokerclient.cpp
@@ -598,25 +598,49 @@ void HttpBrokerClient::slotSslErrors ( QNetworkReply* netReply, const QList<QSsl
"------------\n"<<
tr ( "Issued to:\n" ) <<
tr ( "Common Name(CN)\t" ) <<
+#if QT_VERSION >= 0x050000
+ cert.issuerInfo ( QSslCertificate::CommonName ).join("; ")
+#else
cert.issuerInfo ( QSslCertificate::CommonName )
+#endif
<<endl<<
tr ( "Organization(O)\t" ) <<
+#if QT_VERSION >= 0x050000
+ cert.issuerInfo ( QSslCertificate::Organization ).join("; ")
+#else
cert.issuerInfo ( QSslCertificate::Organization )
+#endif
<<endl<<
tr ( "Organizational Unit(OU)\t" ) <<
+#if QT_VERSION >= 0x050000
+ cert.issuerInfo ( QSslCertificate::OrganizationalUnitName ).join("; ")
+#else
cert.issuerInfo ( QSslCertificate::OrganizationalUnitName )
+#endif
<<endl<<
tr ( "Serial Number\t" ) <<getHexVal ( cert.serialNumber() )
<<endl<<endl<<
tr ( "Issued by:\n" ) <<
tr ( "Common Name(CN)\t" ) <<
+#if QT_VERSION >= 0x050000
+ cert.subjectInfo ( QSslCertificate::CommonName ).join("; ")
+#else
cert.subjectInfo ( QSslCertificate::CommonName )
+#endif
<<endl<<
tr ( "Organization(O)\t" ) <<
+#if QT_VERSION >= 0x050000
+ cert.subjectInfo ( QSslCertificate::Organization ).join("; ")
+#else
cert.subjectInfo ( QSslCertificate::Organization )
+#endif
<<endl<<
tr ( "Organizational Unit(OU)\t" ) <<
+#if QT_VERSION >= 0x050000
+ cert.subjectInfo ( QSslCertificate::OrganizationalUnitName ).join("; ")
+#else
cert.subjectInfo ( QSslCertificate::OrganizationalUnitName )
+#endif
<<endl<<endl<<
tr ( "Validity:\n" ) <<
diff --git a/src/imgframe.cpp b/src/imgframe.cpp
index 4bca5f8..708de17 100644
--- a/src/imgframe.cpp
+++ b/src/imgframe.cpp
@@ -20,7 +20,7 @@
#include "x2goclientconfig.h"
#include <QResizeEvent>
-IMGFrame::IMGFrame(QImage* ,QWidget* parent, Qt::WFlags f) :QFrame(parent,f)
+IMGFrame::IMGFrame(QImage* ,QWidget* parent, Qt::WindowFlags f) :QFrame(parent,f)
{
//setBg(img);
}
diff --git a/src/imgframe.h b/src/imgframe.h
index d894059..1da2fac 100644
--- a/src/imgframe.h
+++ b/src/imgframe.h
@@ -31,7 +31,7 @@ class IMGFrame : public QFrame
{
Q_OBJECT
public:
- IMGFrame(QImage* img,QWidget* parent=0, Qt::WFlags f=0);
+ IMGFrame(QImage* img,QWidget* parent=0, Qt::WindowFlags f=0);
~IMGFrame();
void setBg(QImage* img);
virtual void resizeEvent(QResizeEvent* event);
diff --git a/src/ongetpass.cpp b/src/ongetpass.cpp
index 932db73..464de0f 100644
--- a/src/ongetpass.cpp
+++ b/src/ongetpass.cpp
@@ -35,7 +35,9 @@
#include <signal.h>
#endif
+#if QT_VERSION < 0x050000
#include <QPlastiqueStyle>
+#endif
#include <QMessageBox>
#include <iostream>
#include <QFile>
@@ -51,9 +53,11 @@ int x2goMain ( int argc, char *argv[] )
#ifndef Q_WS_HILDON
#ifdef Q_OS_LINUX
+#if QT_VERSION < 0x050000
app.setStyle ( new QPlastiqueStyle() );
#endif
#endif
+#endif
QStringList args;
if ( argc > 1 )
args=app.arguments();
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index cf9b7fe..3f2df15 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -510,7 +510,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
connect( xineramaTimer, SIGNAL(timeout()), this, SLOT(slotConfigXinerama()));
x2goInfof(3)<<tr("Started X2Go Client.");
- x2goDebug<<"$HOME=" + homeDir.toAscii();
+ x2goDebug<<"$HOME=" + homeDir.toLatin1();
if (thinMode)
{
x2goDebug<<"Thin Mode is active.";
@@ -589,11 +589,11 @@ bool ONMainWindow::get_translator (QString file_name_start, QTranslator **transl
#if QT_VERSION < 0x040800
if (tmp_translator->load (filename)) {
*translator = tmp_translator;
- x2goInfof (4) << tr ("Translator: ") + filename.toAscii () + tr (" found.");
+ x2goInfof (4) << tr ("Translator: ") + filename.toLatin1 () + tr (" found.");
return (true);
}
else {
- x2goWarningf (1) << tr ("Can't load translator: ") + filename.toAscii ();
+ x2goWarningf (1) << tr ("Can't load translator: ") + filename.toLatin1 ();
return (false);
}
#else /* QT_VERSION < 0x040800 */
@@ -617,13 +617,13 @@ bool ONMainWindow::get_translator (QString file_name_start, QTranslator **transl
if (tmp_translator->load (load_filename)) {
/* Some translation successfully loaded. That's good enough. */
- x2goInfof (4) << tr ("Translator: ") + load_filename.toAscii () + tr (" found.");
+ x2goInfof (4) << tr ("Translator: ") + load_filename.toLatin1 () + tr (" found.");
translator_found = true;
*translator = tmp_translator;
break;
}
else {
- x2goWarningf (1) << tr ("Non-fatal: can't load translator: ") + load_filename.toAscii ();
+ x2goWarningf (1) << tr ("Non-fatal: can't load translator: ") + load_filename.toLatin1 ();
x2goWarningf (1) << tr ("Trying to load language with lower preference, if existent.");
}
}
@@ -2787,11 +2787,11 @@ SshMasterConnection* ONMainWindow::startSshConnection ( QString host, QString po
#ifndef Q_OS_WIN
QStringList args=sshEnv[i].split ( "=" );
x2goDebug<<"Setting ENV " + args[0] + tr(" to ") + args[1];
- setenv ( args[0].toAscii(),args[1].toAscii(),1 );
+ setenv ( args[0].toLatin1(),args[1].toLatin1(),1 );
#else
x2goDebug<<"Set ENV: "<<sshEnv[i];
- _putenv ( sshEnv[i].toAscii() );
+ _putenv ( sshEnv[i].toLatin1() );
#endif
}
@@ -3566,7 +3566,7 @@ void ONMainWindow::slotListSessions ( bool result,QString output,
}
else
{
- QString printout = tr( "Connection failed: ") + output.toAscii();
+ QString printout = tr( "Connection failed: ") + output.toLatin1();
if ( output.indexOf ( "publickey,password" ) !=-1 )
x2goErrorf(4)<< tr( "Connection failed: ") + output + tr(" - Wrong password.");
@@ -6709,7 +6709,7 @@ void ONMainWindow::slotReadApplications(bool result, QString output,
QString line=lines[i];
if (line.indexOf("Name["+localshort+"]=")!=-1 || line.indexOf("Name["+locallong+"]=")!=-1)
{
- app.name=QString::fromUtf8(line.split("=")[1].toAscii());
+ app.name=QString::fromUtf8(line.split("=")[1].toLatin1());
// x2goDebug<<"local name: "<<app.name<<endl;
@@ -6717,7 +6717,7 @@ void ONMainWindow::slotReadApplications(bool result, QString output,
}
if (line.indexOf("Comment["+localshort+"]=")!=-1 || line.indexOf("Comment["+locallong+"]=")!=-1)
{
- app.comment=QString::fromUtf8(line.split("=")[1].toAscii());
+ app.comment=QString::fromUtf8(line.split("=")[1].toLatin1());
// x2goDebug<<"local comment: "<<app.comment<<endl;
localcomment=true;
}
@@ -6780,9 +6780,9 @@ void ONMainWindow::slotReadApplications(bool result, QString output,
QByteArray pic;
while (line.indexOf("</icon>")==-1)
{
- pic+=QByteArray::fromBase64(line.toAscii());
+ pic+=QByteArray::fromBase64(line.toLatin1());
line=lines[++i];
- if (QString(QByteArray::fromBase64(line.toAscii())).indexOf("</svg>",Qt::CaseInsensitive)!=-1)
+ if (QString(QByteArray::fromBase64(line.toLatin1())).indexOf("</svg>",Qt::CaseInsensitive)!=-1)
{
isSvg=true;
}
@@ -8071,7 +8071,7 @@ void ONMainWindow::slotCopyKey ( bool result, QString output, int pid)
}
else
{
- QString printout = tr( "Connection failed: ") + output.toAscii();
+ QString printout = tr( "Connection failed: ") + output.toLatin1();
if ( output.indexOf ( "publickey,password" ) !=-1 )
x2goErrorf(11)<< tr( "Connection failed: ") + output + tr(" - Wrong password.");
@@ -11924,7 +11924,7 @@ void ONMainWindow::printSshDError_noHostPubKey()
"<ul>"
"<li>Open a <b>Terminal Window</b> (Applications -> Utilities -> Terminal)</li>"
- "<li>Run this command: <b>ssh -p " + clientSshPort.toAscii ()
+ "<li>Run this command: <b>ssh -p " + clientSshPort.toLatin1 ()
+ " localhost</b></li>"
"<li>You do not need to login. Just quit the Terminal application "
"via Cmd + Q</li>"
@@ -12412,13 +12412,13 @@ void ONMainWindow::doPluginInit()
QString path=getenv ( "PATH" );
path=clientDir+":"+pluginDir+":"+path;
- setenv ( "PATH",path.toAscii (),1 );
+ setenv ( "PATH",path.toLatin1 (),1 );
path=getenv ( "LD_LIBRARY_PATH" );
path=clientDir+":"+pluginDir+":"+path;
- setenv ( "LD_LIBRARY_PATH",path.toAscii () ,1 );
+ setenv ( "LD_LIBRARY_PATH",path.toLatin1 () ,1 );
- setenv ( "X2GO_LIB",clientDir.toAscii () ,1 );
+ setenv ( "X2GO_LIB",clientDir.toLatin1 () ,1 );
QFile::setPermissions (
clientDir+"/x2goclient",
diff --git a/src/onmainwindow_privat.h b/src/onmainwindow_privat.h
index 3a0f087..436bfcf 100644
--- a/src/onmainwindow_privat.h
+++ b/src/onmainwindow_privat.h
@@ -67,10 +67,11 @@
#include <QCheckBox>
#include <QTemporaryFile>
#include <QFileDialog>
-#include <QHttp>
#include <QUrl>
#include <QLocalSocket>
+#if QT_VERSION < 0x050000
#include <QPlastiqueStyle>
+#endif
#include "imgframe.h"
#include <QToolTip>
#include "clicklineedit.h"
@@ -149,7 +150,11 @@
#endif
#ifdef Q_OS_LINUX
+#if QT_VERSION < 0x050000
#include <QX11Info>
+#else
+#include <QtX11Extras/QX11Info>
+#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp
index 92771fb..e5e250a 100644
--- a/src/sessionbutton.cpp
+++ b/src/sessionbutton.cpp
@@ -322,13 +322,13 @@ void SessionButton::redraw()
sessIcon = expandHome(sessIcon);
QPixmap* pix;
- x2goDebug << "Creating QPixmap with session icon: " << sessIcon.toAscii () << ".";
+ x2goDebug << "Creating QPixmap with session icon: " << sessIcon.toLatin1 () << ".";
if (!par->brokerMode || sessIcon == ":/img/icons/128x128/x2gosession.png")
pix=new QPixmap( sessIcon );
else
{
pix=new QPixmap;
- pix->loadFromData(QByteArray::fromBase64(sessIcon.toAscii()));
+ pix->loadFromData(QByteArray::fromBase64(sessIcon.toLatin1()));
}
if ( !par->retMiniMode() )
icon->setPixmap ( pix->scaled ( 64,64,Qt::IgnoreAspectRatio,
diff --git a/src/sessionexplorer.cpp b/src/sessionexplorer.cpp
index 219234f..973d8bf 100644
--- a/src/sessionexplorer.cpp
+++ b/src/sessionexplorer.cpp
@@ -189,8 +189,13 @@ void SessionExplorer::slotCreateDesktopIcon ( SessionButton* bt )
#ifndef Q_OS_WIN
QFile file (
+#if QT_VERSION < 0x050000
QDesktopServices::storageLocation (
QDesktopServices::DesktopLocation ) +"/"+name+".desktop" );
+#else
+ QStandardPaths::writableLocation(
+ QStandardPaths::DesktopLocation) +"/"+name+".desktop" );
+#endif
if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text ) )
return;
diff --git a/src/sessionmanagedialog.cpp b/src/sessionmanagedialog.cpp
index 8b39316..0f7d44b 100644
--- a/src/sessionmanagedialog.cpp
+++ b/src/sessionmanagedialog.cpp
@@ -35,7 +35,7 @@
#define SESSIONIDROLE Qt::UserRole+2
SessionManageDialog::SessionManageDialog ( QWidget * parent,
- bool onlyCreateIcon, Qt::WFlags f )
+ bool onlyCreateIcon, Qt::WindowFlags f )
: QDialog ( parent, f )
{
QVBoxLayout* ml=new QVBoxLayout ( this );
diff --git a/src/sessionmanagedialog.h b/src/sessionmanagedialog.h
index 0428797..3ce7cd7 100644
--- a/src/sessionmanagedialog.h
+++ b/src/sessionmanagedialog.h
@@ -35,7 +35,7 @@ class SessionManageDialog : public QDialog
public:
SessionManageDialog ( QWidget * parent,
bool onlyCreateIcon=false,
- Qt::WFlags f=0 );
+ Qt::WindowFlags f=0 );
~SessionManageDialog();
void loadSessions();
private:
diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp
index bb69047..8ebac10 100644
--- a/src/sshmasterconnection.cpp
+++ b/src/sshmasterconnection.cpp
@@ -99,7 +99,7 @@ void SshMasterConnection::parseKnownHosts()
QString keyName=type+"@"+port+":"+hostParts[0];
- QByteArray bytes=QByteArray::fromBase64(parts[2].toAscii());
+ QByteArray bytes=QByteArray::fromBase64(parts[2].toLatin1());
QStringList fields;
//key is a set of data fields:
@@ -332,10 +332,10 @@ void SshMasterConnection::checkReverseTunnelConnections()
x2goDebug<<"Connecting to "<<req.localHost<<":"<<req.localPort<<endl;
#endif
#ifndef Q_OS_WIN
- inet_aton ( req.localHost.toAscii(), &address.sin_addr );
+ inet_aton ( req.localHost.toLatin1(), &address.sin_addr );
#else
address.sin_addr.s_addr=inet_addr (
- req.localHost.toAscii() );
+ req.localHost.toLatin1() );
#endif
if ( ::connect ( sock, ( struct sockaddr * ) &address,sizeof ( address ) ) !=0 )
@@ -639,7 +639,7 @@ void SshMasterConnection::run()
#ifdef Q_OS_WIN
ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, user.toLocal8Bit() );
#else
- ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, user.toAscii() );
+ ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, user.toLatin1() );
#endif
#ifdef Q_OS_WIN
@@ -876,7 +876,7 @@ bool SshMasterConnection::userChallengeAuth()
#ifdef DEBUG
x2goDebug<<"Password request"<<endl;
#endif
- ssh_userauth_kbdint_setanswer(my_ssh_session,0,pass.toAscii());
+ ssh_userauth_kbdint_setanswer(my_ssh_session,0,pass.toLatin1());
return userChallengeAuth();
}
@@ -920,7 +920,7 @@ bool SshMasterConnection::userChallengeAuth()
return false;
}
}
- ssh_userauth_kbdint_setanswer(my_ssh_session,0,challengeAuthVerificationCode.toAscii());
+ ssh_userauth_kbdint_setanswer(my_ssh_session,0,challengeAuthVerificationCode.toLatin1());
return userChallengeAuth();
}
QString err=ssh_get_error ( my_ssh_session );
@@ -992,7 +992,7 @@ bool SshMasterConnection::userAuthWithPass()
#ifdef DEBUG
x2goDebug<<"Password authentication requested."<<endl;
#endif
- int rc = ssh_userauth_password ( my_ssh_session, NULL, pass.toAscii() );
+ int rc = ssh_userauth_password ( my_ssh_session, NULL, pass.toLatin1() );
if ( rc != SSH_AUTH_SUCCESS )
{
QString err=ssh_get_error ( my_ssh_session );
@@ -1031,7 +1031,7 @@ bool SshMasterConnection::userAuthAuto()
}
if(keyPhrase==QString::null)
break;
- rc = ssh_userauth_autopubkey ( my_ssh_session, keyPhrase.toAscii() );
+ rc = ssh_userauth_autopubkey ( my_ssh_session, keyPhrase.toLatin1() );
if(i++==2)
{
break;
@@ -1084,7 +1084,7 @@ bool SshMasterConnection::userAuthWithKey()
#endif
}
- ssh_private_key prkey=privatekey_from_file(my_ssh_session, keyName.toAscii(), 0,"");
+ ssh_private_key prkey=privatekey_from_file(my_ssh_session, keyName.toLatin1(), 0,"");
int i=0;
while(!prkey)
{
@@ -1103,7 +1103,7 @@ bool SshMasterConnection::userAuthWithKey()
}
if(keyPhrase==QString::null)
break;
- prkey=privatekey_from_file(my_ssh_session, keyName.toAscii(), 0,keyPhrase.toAscii());
+ prkey=privatekey_from_file(my_ssh_session, keyName.toLatin1(), 0,keyPhrase.toLatin1());
if(i++==2)
{
break;
@@ -1135,8 +1135,8 @@ bool SshMasterConnection::userAuthWithKey()
//not implemented before libssh 0.5
/* int rc = ssh_userauth_privatekey_file ( my_ssh_session,NULL,
- keyName.toAscii(),
- pass.toAscii() );*/
+ keyName.toLatin1(),
+ pass.toLatin1() );*/
int rc=ssh_userauth_pubkey(my_ssh_session, NULL, pubkeyStr, prkey);
privatekey_free(prkey);
@@ -1342,7 +1342,7 @@ void SshMasterConnection::copy()
#ifdef DEBUG
x2goDebug<<"SSH Master Connection copy - dst path:"<<dstPath<<" file:"<<dstFile<<endl;
#endif
- ssh_scp scp=ssh_scp_new ( my_ssh_session, SSH_SCP_WRITE|SSH_SCP_RECURSIVE, dstPath.toAscii() );
+ ssh_scp scp=ssh_scp_new ( my_ssh_session, SSH_SCP_WRITE|SSH_SCP_RECURSIVE, dstPath.toLatin1() );
if ( scp == NULL )
{
#ifdef DEBUG
@@ -1371,7 +1371,7 @@ void SshMasterConnection::copy()
}
QByteArray arr=file.readAll();
file.close();
- rc=ssh_scp_push_file ( scp,dstFile.toAscii(),arr.size(), 0600 );
+ rc=ssh_scp_push_file ( scp,dstFile.toLatin1(),arr.size(), 0600 );
if ( rc != SSH_OK )
{
QString errMsg=tr ( "Cannot create remote file " ) +copyRequests[i].dst;
@@ -1514,9 +1514,9 @@ void SshMasterConnection::channelLoop()
x2goDebug<<"Forwarding new channel, local port: "<<channelConnections.at ( i ).localPort<<endl;
#endif
if ( channel_open_forward ( channel,
- channelConnections.at ( i ).forwardHost.toAscii(),
+ channelConnections.at ( i ).forwardHost.toLatin1(),
channelConnections.at ( i ).forwardPort,
- channelConnections.at ( i ).localHost.toAscii(),
+ channelConnections.at ( i ).localHost.toLatin1(),
channelConnections.at ( i ).localPort ) != SSH_OK )
{
QString err=ssh_get_error ( my_ssh_session );
@@ -1547,7 +1547,7 @@ void SshMasterConnection::channelLoop()
x2goDebug<<errorMsg<<": "<<err<<endl;
#endif
}
- else if ( channel_request_exec ( channel, channelConnections[i].command.toAscii() ) != SSH_OK )
+ else if ( channel_request_exec ( channel, channelConnections[i].command.toLatin1() ) != SSH_OK )
{
QString err=ssh_get_error ( my_ssh_session );
QString errorMsg=tr ( "channel_request_exec failed" );
diff --git a/x2goclient.pro b/x2goclient.pro
index 07290ab..febffb9 100644
--- a/x2goclient.pro
+++ b/x2goclient.pro
@@ -234,6 +234,7 @@ win32-* {
CONFIG += static release
}
QT += svg network
+greaterThan(QT_MAJOR_VERSION, 4): QT += x11extras
QMAKE_CXXFLAGS_DEBUG -= -g
QMAKE_CXXFLAGS_DEBUG += -O2 -g3 -ggdb3 -gdwarf-4
--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list