diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-03-27 16:44:41 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-03-27 16:44:41 +0100 |
commit | 1f8ec5b6a4bed3cfa02eaa36d39bceb7d37fc891 (patch) | |
tree | f225e5fe3d34ba9468634628338a16b1d087071f /src/libs | |
parent | b170fae8b21e25b9ddfc66f985e7d7040ab3d2c0 (diff) | |
parent | ddf7aa85ec7bada4a96b2692e4b9f1bdd709cbad (diff) |
Merge remote-tracking branch 'origin/1.5'
Conflicts:
installerfw.pri
Change-Id: I8bd85997fef0fcfa21a4dd28a6362748a54a4a3b
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/installer/adminauthorization_x11.cpp | 8 | ||||
-rw-r--r-- | src/libs/installer/downloadarchivesjob.cpp | 7 | ||||
-rw-r--r-- | src/libs/installer/fsengineserver.cpp | 7 | ||||
-rw-r--r-- | src/libs/installer/graph.h | 2 | ||||
-rw-r--r-- | src/libs/installer/packagemanagergui.cpp | 9 | ||||
-rw-r--r-- | src/libs/installer/repository.cpp | 6 | ||||
-rw-r--r-- | src/libs/kdtools/kdupdaterfiledownloader.cpp | 2 | ||||
-rw-r--r-- | src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp | 21 | ||||
-rw-r--r-- | src/libs/kdtools/kdupdaterfiledownloaderfactory.h | 14 | ||||
-rw-r--r-- | src/libs/kdtools/kdupdaterpackagesinfo.cpp | 2 |
10 files changed, 44 insertions, 34 deletions
diff --git a/src/libs/installer/adminauthorization_x11.cpp b/src/libs/installer/adminauthorization_x11.cpp index d2d1ad669..92567050a 100644 --- a/src/libs/installer/adminauthorization_x11.cpp +++ b/src/libs/installer/adminauthorization_x11.cpp @@ -177,19 +177,21 @@ bool AdminAuthorization::execute(QWidget *parent, const QString &program, const QRegExp re(QLatin1String("[Pp]assword.*:")); QByteArray errData; flags = ::fcntl(masterFD, F_GETFD); -// if (flags != -1) -// ::fcntl(masterFD, F_SETFL, flags | O_NONBLOCK); int bytes = 0; int errBytes = 0; char buf[1024]; + char errBuf[1024]; while (bytes >= 0) { int state; if (::waitpid(child, &state, WNOHANG) == -1) break; bytes = ::read(masterFD, buf, 1023); - errBytes = ::read(pipedData[0], buf, 1023); + errBytes = ::read(pipedData[0], errBuf, 1023); if (errBytes > 0) + { errData.append(buf, errBytes); + errBytes=0; + } if (bytes > 0) { const QString line = QString::fromLatin1(buf, bytes); if (re.indexIn(line) != -1) { diff --git a/src/libs/installer/downloadarchivesjob.cpp b/src/libs/installer/downloadarchivesjob.cpp index 82f9b365c..620eedd60 100644 --- a/src/libs/installer/downloadarchivesjob.cpp +++ b/src/libs/installer/downloadarchivesjob.cpp @@ -319,10 +319,9 @@ KDUpdater::FileDownloader *DownloadArchivesJob::setupDownloader(const QString &s Qt::QueuedConnection); connect(downloader, SIGNAL(downloadStatus(QString)), this, SIGNAL(downloadStatusChanged(QString))); - if (scheme == QLatin1String("http") || scheme == QLatin1String("ftp") || - scheme == QLatin1String("file")) { - downloader->setDownloadedFileName(component->localTempPath() + QLatin1String("/") - + component->name() + QLatin1String("/") + fi.fileName() + suffix); + if (FileDownloaderFactory::isSupportedScheme(scheme)) { + downloader->setDownloadedFileName(component->localTempPath() + QLatin1Char('/') + + component->name() + QLatin1Char('/') + fi.fileName() + suffix); } QString message = tr("Downloading archive hash for component: %1"); diff --git a/src/libs/installer/fsengineserver.cpp b/src/libs/installer/fsengineserver.cpp index 326a2a02a..669ed4248 100644 --- a/src/libs/installer/fsengineserver.cpp +++ b/src/libs/installer/fsengineserver.cpp @@ -467,7 +467,14 @@ QByteArray FSEngineConnectionThread::handleCommand(const QString &command) receivedStream >> byteArray; returnStream << process->write(byteArray); } +#ifdef Q_OS_WIN + else if (command == QLatin1String("QProcess::setNativeArguments")) { + QString arguments; + receivedStream >> arguments; + process->setNativeArguments(arguments); + } +#endif // from here, QFSEngine handling else if (command == QLatin1String("QFSFileEngine::atEnd")) { returnStream << engine.atEnd(); diff --git a/src/libs/installer/graph.h b/src/libs/installer/graph.h index 59778a440..04fdb941c 100644 --- a/src/libs/installer/graph.h +++ b/src/libs/installer/graph.h @@ -144,7 +144,7 @@ private: foreach (const T &adjacency, edges(node)) visit(adjacency, resolvedNodes, visitedNodes); - // append this node the the ordered list + // append this node to the ordered list resolvedNodes->append(node); } diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 9d6414adc..1757f21f5 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -123,9 +123,7 @@ public: , m_widget(widget) { setObjectName(QLatin1String("Dynamic") + widget->objectName()); - setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); - setPixmap(QWizard::BannerPixmap, QPixmap()); setLayout(new QVBoxLayout); setColoredSubTitle(QLatin1String(" ")); @@ -903,13 +901,6 @@ LicenseAgreementPage::LicenseAgreementPage(PackageManagerCore *core) m_rejectLabel->setObjectName(QLatin1String("RejectLicenseLabel")); m_rejectLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); -#ifdef Q_OS_UNIX - QFont labelFont(font()); - labelFont.setPixelSize(9); - m_acceptLabel->setFont(labelFont); - m_rejectLabel->setFont(labelFont); -#endif - QGridLayout *gridLayout = new QGridLayout; gridLayout->setColumnStretch(1, 1); gridLayout->addWidget(m_acceptRadioButton, 0, 0); diff --git a/src/libs/installer/repository.cpp b/src/libs/installer/repository.cpp index 786cb2a49..261bdaac9 100644 --- a/src/libs/installer/repository.cpp +++ b/src/libs/installer/repository.cpp @@ -40,6 +40,7 @@ **************************************************************************/ #include "repository.h" +#include "kdupdaterfiledownloaderfactory.h" #include <QFileInfo> #include <QStringList> @@ -89,11 +90,8 @@ Repository::Repository(const QUrl &url, bool isDefault) */ Repository Repository::fromUserInput(const QString &repositoryUrl) { - QStringList supportedSchemes; - supportedSchemes << QLatin1String("http") << QLatin1String("https") << QLatin1String("ftp") << - QLatin1String("file"); - QUrl url = QUrl::fromUserInput(repositoryUrl); + const QStringList supportedSchemes = KDUpdater::FileDownloaderFactory::supportedSchemes(); if (!supportedSchemes.contains(url.scheme()) && QFileInfo(url.toString()).exists()) url = QLatin1String("file:///") + url.toString(); diff --git a/src/libs/kdtools/kdupdaterfiledownloader.cpp b/src/libs/kdtools/kdupdaterfiledownloader.cpp index 95b574b2f..cbd4ee184 100644 --- a/src/libs/kdtools/kdupdaterfiledownloader.cpp +++ b/src/libs/kdtools/kdupdaterfiledownloader.cpp @@ -714,7 +714,7 @@ QString KDUpdater::ResourceFileDownloader::downloadedFileName() const void KDUpdater::ResourceFileDownloader::setDownloadedFileName(const QString &/*name*/) { - Q_ASSERT_X(false, "KDUpdater::ResourceFileDownloader::setDownloadedFileName", "Not supported!"); + // Not supported! } KDUpdater::ResourceFileDownloader *KDUpdater::ResourceFileDownloader::clone(QObject *parent) const diff --git a/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp b/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp index 7f6e72efb..92dff42ee 100644 --- a/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp +++ b/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp @@ -59,16 +59,6 @@ using namespace KDUpdater; -struct FileDownloaderFactory::FileDownloaderFactoryData -{ - FileDownloaderFactoryData() : m_factory(0) {} - ~FileDownloaderFactoryData() { delete m_factory; } - - bool m_followRedirects; - bool m_ignoreSslErrors; - FileDownloaderProxyFactory *m_factory; -}; - FileDownloaderFactory& FileDownloaderFactory::instance() { static KDUpdater::FileDownloaderFactory theFactory; @@ -129,6 +119,17 @@ FileDownloaderFactory::~FileDownloaderFactory() delete d; } +QStringList FileDownloaderFactory::supportedSchemes() +{ + return FileDownloaderFactory::instance().d->m_supportedSchemes; +} + +bool FileDownloaderFactory::isSupportedScheme(const QString &scheme) +{ + return FileDownloaderFactory::instance().d->m_supportedSchemes.contains(scheme + , Qt::CaseInsensitive); +} + /*! Returns a new instance to the \ref KDUpdater::FileDownloader based whose scheme is equal to the string passed as parameter to this function. diff --git a/src/libs/kdtools/kdupdaterfiledownloaderfactory.h b/src/libs/kdtools/kdupdaterfiledownloaderfactory.h index a4338e3ce..5377923fe 100644 --- a/src/libs/kdtools/kdupdaterfiledownloaderfactory.h +++ b/src/libs/kdtools/kdupdaterfiledownloaderfactory.h @@ -68,6 +68,15 @@ class KDTOOLS_EXPORT FileDownloaderProxyFactory : public QNetworkProxyFactory class KDTOOLS_EXPORT FileDownloaderFactory : public KDGenericFactory<FileDownloader> { Q_DISABLE_COPY(FileDownloaderFactory) + struct FileDownloaderFactoryData { + FileDownloaderFactoryData() : m_factory(0) {} + ~FileDownloaderFactoryData() { delete m_factory; } + + bool m_followRedirects; + bool m_ignoreSslErrors; + QStringList m_supportedSchemes; + FileDownloaderProxyFactory *m_factory; + }; public: static FileDownloaderFactory &instance(); @@ -77,6 +86,7 @@ public: void registerFileDownloader(const QString &scheme) { registerProduct<T>(scheme); + d->m_supportedSchemes.append(scheme); } FileDownloader *create(const QString &scheme, QObject *parent = 0) const; @@ -88,11 +98,13 @@ public: static bool ignoreSslErrors(); static void setIgnoreSslErrors(bool ignore); + static QStringList supportedSchemes(); + static bool isSupportedScheme(const QString &scheme); + private: FileDownloaderFactory(); private: - struct FileDownloaderFactoryData; FileDownloaderFactoryData *d; }; diff --git a/src/libs/kdtools/kdupdaterpackagesinfo.cpp b/src/libs/kdtools/kdupdaterpackagesinfo.cpp index 80c96dc5a..1e882e173 100644 --- a/src/libs/kdtools/kdupdaterpackagesinfo.cpp +++ b/src/libs/kdtools/kdupdaterpackagesinfo.cpp @@ -55,7 +55,7 @@ using namespace KDUpdater; \brief Provides access to information about packages installed on the application side. This class parses the XML package file specified via the setFileName() method and - provides access to the the information defined within the package file through an + provides access to the information defined within the package file through an easy to use API. You can: \li get application name via the \ref applicationName() method \li get application version via the \ref applicationVersion() method |