Cleanup in PathChooser and FileUtils

Mostly use HostOsInfo instead of direct macros.

Change-Id: Ic6da7c987268fc8a0d06057e17c5bc0b131cbcb2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
hjk
2012-12-20 17:14:18 +01:00
parent 9043898f6f
commit 4e8b5c6dfc
2 changed files with 83 additions and 94 deletions

View File

@@ -34,19 +34,19 @@
#include "qtcassert.h"
#include "synchronousprocess.h"
#include "hostosinfo.h"
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QSettings>
#include <QProcess>
#include <qevent.h>
#include <QDesktopServices>
#include <QDir>
#include <QEvent>
#include <QFileDialog>
#include <QFileInfo>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QProcess>
#include <QPushButton>
#include <QSettings>
/*!
\class Utils::PathChooser
@@ -57,7 +57,7 @@
Has some validation logic for embedding into QWizardPage.
*/
/*static*/ const char * const Utils::PathChooser::browseButtonLabel =
const char * const Utils::PathChooser::browseButtonLabel =
#ifdef Q_OS_MAC
QT_TRANSLATE_NOOP("Utils::PathChooser", "Choose...");
#else
@@ -541,14 +541,12 @@ QString PathChooser::label()
QString PathChooser::homePath()
{
#ifdef Q_OS_WIN
// Return 'users/<name>/Documents' on Windows, since Windows explorer
// does not let people actually display the contents of their home
// directory. Alternatively, create a QtCreator-specific directory?
return QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
#else
if (HostOsInfo::isWindowsHost())
return QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
return QDir::homePath();
#endif
}
void PathChooser::setExpectedKind(Kind expected)