Utils: Remove unneeded namespace qualifications

Change-Id: Iacab8410ab4d3b63f96e7541b450e3cc729ab662
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Orgad Shaneh
2014-07-15 23:33:17 +03:00
committed by hjk
parent e639455936
commit 62d98daa58
33 changed files with 111 additions and 110 deletions

View File

@@ -59,7 +59,7 @@ public:
};
BaseTreeView::BaseTreeView(QWidget *parent)
: Utils::TreeView(parent)
: TreeView(parent)
{
setAttribute(Qt::WA_MacShowFocusRect, false);
setFrameStyle(QFrame::NoFrame);
@@ -87,7 +87,7 @@ void BaseTreeView::setModel(QAbstractItemModel *m)
if (index != -1)
disconnect(model(), SIGNAL(columnAdjustmentRequested()), this, SLOT(resizeColumns()));
}
Utils::TreeView::setModel(m);
TreeView::setModel(m);
if (m) {
int index = m->metaObject()->indexOfSignal(sig);
if (index != -1)
@@ -97,7 +97,7 @@ void BaseTreeView::setModel(QAbstractItemModel *m)
void BaseTreeView::mousePressEvent(QMouseEvent *ev)
{
Utils::TreeView::mousePressEvent(ev);
TreeView::mousePressEvent(ev);
const QModelIndex mi = indexAt(ev->pos());
if (!mi.isValid())
toggleColumnWidth(columnAt(ev->x()));

View File

@@ -36,7 +36,7 @@
namespace Utils {
class QTCREATOR_UTILS_EXPORT BaseTreeView : public Utils::TreeView
class QTCREATOR_UTILS_EXPORT BaseTreeView : public TreeView
{
Q_OBJECT

View File

@@ -64,7 +64,7 @@ QString BuildableHelperLibrary::qtChooserToQmakePath(const QString &path)
return result;
}
Utils::FileName BuildableHelperLibrary::findSystemQt(const Utils::Environment &env)
FileName BuildableHelperLibrary::findSystemQt(const Environment &env)
{
QStringList paths = env.path();
foreach (const QString &path, paths) {
@@ -78,11 +78,11 @@ Utils::FileName BuildableHelperLibrary::findSystemQt(const Utils::Environment &e
qmake.setFile(qtChooserToQmakePath(qmake.symLinkTarget()));
if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull())
return Utils::FileName(qmake);
return FileName(qmake);
}
}
}
return Utils::FileName();
return FileName();
}
QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath)
@@ -105,7 +105,7 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath, bool
return QString();
}
if (!qmake.waitForFinished()) {
Utils::SynchronousProcess::stopProcess(qmake);
SynchronousProcess::stopProcess(qmake);
qWarning("Timeout running '%s'.", qPrintable(qmakePath));
return QString();
}

View File

@@ -42,7 +42,7 @@ class QTCREATOR_UTILS_EXPORT BuildableHelperLibrary
public:
// returns the full path to the first qmake, qmake-qt4, qmake4 that has
// at least version 2.0.0 and thus is a qt4 qmake
static FileName findSystemQt(const Utils::Environment &env);
static FileName findSystemQt(const Environment &env);
static bool isQtChooser(const QFileInfo &info);
static QString qtChooserToQmakePath(const QString &path);
// return true if the qmake at qmakePath is qt4 (used by QtVersion)
@@ -63,11 +63,11 @@ public:
struct BuildHelperArguments {
QString helperName;
QString directory;
Utils::Environment environment;
Environment environment;
Utils::FileName qmakeCommand;
FileName qmakeCommand;
QString targetMode;
Utils::FileName mkspec;
FileName mkspec;
QString proFilename;
QStringList qmakeArguments;

View File

@@ -65,7 +65,7 @@ ClassNameValidatingLineEditPrivate:: ClassNameValidatingLineEditPrivate() :
// --------------------- ClassNameValidatingLineEdit
ClassNameValidatingLineEdit::ClassNameValidatingLineEdit(QWidget *parent) :
Utils::FancyLineEdit(parent),
FancyLineEdit(parent),
d(new ClassNameValidatingLineEditPrivate)
{
updateRegExp();

View File

@@ -36,8 +36,7 @@ namespace Utils {
struct ClassNameValidatingLineEditPrivate;
class QTCREATOR_UTILS_EXPORT ClassNameValidatingLineEdit
: public Utils::FancyLineEdit
class QTCREATOR_UTILS_EXPORT ClassNameValidatingLineEdit : public FancyLineEdit
{
Q_OBJECT
Q_PROPERTY(bool namespacesEnabled READ namespacesEnabled WRITE setNamespacesEnabled DESIGNABLE true)

View File

@@ -150,7 +150,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
}
QString stubPath = QCoreApplication::applicationDirPath();
if (Utils::HostOsInfo::isMacHost())
if (HostOsInfo::isMacHost())
stubPath.append(QLatin1String("/../Resources/qtcreator_process_stub"));
else
stubPath.append(QLatin1String("/qtcreator_process_stub"));
@@ -363,7 +363,7 @@ static const Terminal knownTerminals[] =
QString ConsoleProcess::defaultTerminalEmulator()
{
if (Utils::HostOsInfo::isMacHost()) {
if (HostOsInfo::isMacHost()) {
QString termCmd = QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/scripts/openTerminal.command");
if (QFile(termCmd).exists())
return termCmd.replace(QLatin1Char(' '), QLatin1String("\\ "));

View File

@@ -121,18 +121,18 @@ void CrumblePathButton::paintEvent(QPaintEvent *)
if (m_isEnd) {
if (m_isPressed || m_isSelected)
Utils::StyleHelper::drawCornerImage(m_segmentSelectedEnd, &p, geom, 2, 0, 2, 0);
StyleHelper::drawCornerImage(m_segmentSelectedEnd, &p, geom, 2, 0, 2, 0);
else if (m_isHovering)
Utils::StyleHelper::drawCornerImage(m_segmentHoverEnd, &p, geom, 2, 0, 2, 0);
StyleHelper::drawCornerImage(m_segmentHoverEnd, &p, geom, 2, 0, 2, 0);
else
Utils::StyleHelper::drawCornerImage(m_segmentEnd, &p, geom, 2, 0, 2, 0);
StyleHelper::drawCornerImage(m_segmentEnd, &p, geom, 2, 0, 2, 0);
} else {
if (m_isPressed || m_isSelected)
Utils::StyleHelper::drawCornerImage(m_segmentSelected, &p, geom, 2, 0, 12, 0);
StyleHelper::drawCornerImage(m_segmentSelected, &p, geom, 2, 0, 12, 0);
else if (m_isHovering)
Utils::StyleHelper::drawCornerImage(m_segmentHover, &p, geom, 2, 0, 12, 0);
StyleHelper::drawCornerImage(m_segmentHover, &p, geom, 2, 0, 12, 0);
else
Utils::StyleHelper::drawCornerImage(m_segment, &p, geom, 2, 0, 12, 0);
StyleHelper::drawCornerImage(m_segment, &p, geom, 2, 0, 12, 0);
}
if (isEnabled())
p.setPen(StyleHelper::panelTextColor());

View File

@@ -78,7 +78,7 @@ public:
QLabel *m_summaryLabel;
QCheckBox *m_summaryCheckBox;
QLabel *m_additionalSummaryLabel;
Utils::FadingPanel *m_toolWidget;
FadingPanel *m_toolWidget;
QWidget *m_widget;
QPixmap m_collapsedPixmap;
@@ -375,7 +375,7 @@ void DetailsWidget::setWidget(QWidget *widget)
d->updateControls();
}
void DetailsWidget::setToolWidget(Utils::FadingPanel *widget)
void DetailsWidget::setToolWidget(FadingPanel *widget)
{
if (d->m_toolWidget == widget)
return;

View File

@@ -73,7 +73,7 @@ public:
QWidget *widget() const;
QWidget *takeWidget();
void setToolWidget(Utils::FadingPanel *widget);
void setToolWidget(FadingPanel *widget);
QWidget *toolWidget() const;
void setSummaryFontBold(bool b);

View File

@@ -373,23 +373,23 @@ QList<EnvironmentItem> Environment::diff(const Environment &other) const
QList<EnvironmentItem> result;
while (thisIt != constEnd() || otherIt != other.constEnd()) {
if (thisIt == constEnd()) {
result.append(Utils::EnvironmentItem(otherIt.key(), otherIt.value()));
result.append(EnvironmentItem(otherIt.key(), otherIt.value()));
++otherIt;
} else if (otherIt == constEnd()) {
Utils::EnvironmentItem item(thisIt.key(), QString());
EnvironmentItem item(thisIt.key(), QString());
item.unset = true;
result.append(item);
++thisIt;
} else if (thisIt.key() < otherIt.key()) {
Utils::EnvironmentItem item(thisIt.key(), QString());
EnvironmentItem item(thisIt.key(), QString());
item.unset = true;
result.append(item);
++thisIt;
} else if (thisIt.key() > otherIt.key()) {
result.append(Utils::EnvironmentItem(otherIt.key(), otherIt.value()));
result.append(EnvironmentItem(otherIt.key(), otherIt.value()));
++otherIt;
} else {
result.append(Utils::EnvironmentItem(otherIt.key(), otherIt.value()));
result.append(EnvironmentItem(otherIt.key(), otherIt.value()));
++otherIt;
++thisIt;
}

View File

@@ -47,7 +47,7 @@ public:
m_resultEnvironment.modify(m_items);
// Add removed variables again and mark them as "<UNSET>" so
// that the user can actually see those removals:
foreach (const Utils::EnvironmentItem &item, m_items) {
foreach (const EnvironmentItem &item, m_items) {
if (item.unset)
m_resultEnvironment.set(item.name, EnvironmentModel::tr("<UNSET>"));
}
@@ -63,7 +63,7 @@ public:
int findInResultInsertPosition(const QString &name) const
{
Utils::Environment::const_iterator it;
Environment::const_iterator it;
int i = 0;
for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
if (m_resultEnvironment.key(it) > name)
@@ -73,7 +73,7 @@ public:
int findInResult(const QString &name) const
{
Utils::Environment::const_iterator it;
Environment::const_iterator it;
int i = 0;
for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
if (m_resultEnvironment.key(it) == name)
@@ -81,9 +81,9 @@ public:
return -1;
}
Utils::Environment m_baseEnvironment;
Utils::Environment m_resultEnvironment;
QList<Utils::EnvironmentItem> m_items;
Environment m_baseEnvironment;
Environment m_resultEnvironment;
QList<EnvironmentItem> m_items;
};
} // namespace Internal
@@ -103,7 +103,7 @@ QString EnvironmentModel::indexToVariable(const QModelIndex &index) const
return d->m_resultEnvironment.key(d->m_resultEnvironment.constBegin() + index.row());
}
void EnvironmentModel::setBaseEnvironment(const Utils::Environment &env)
void EnvironmentModel::setBaseEnvironment(const Environment &env)
{
if (d->m_baseEnvironment == env)
return;
@@ -215,7 +215,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
if (d->m_resultEnvironment.hasKey(newName) || newName.isEmpty())
return false;
Utils::EnvironmentItem newVariable(newName, oldValue);
EnvironmentItem newVariable(newName, oldValue);
if (changesPos != -1)
resetVariable(oldName); // restore the original base variable again
@@ -238,7 +238,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
}
} else {
// Add a new change item:
d->m_items.append(Utils::EnvironmentItem(oldName, stringValue));
d->m_items.append(EnvironmentItem(oldName, stringValue));
}
d->updateResultEnvironment();
emit dataChanged(index, index);
@@ -251,12 +251,12 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
QModelIndex EnvironmentModel::addVariable()
{
//: Name when inserting a new variable
return addVariable(Utils::EnvironmentItem(tr("<VARIABLE>"),
return addVariable(EnvironmentItem(tr("<VARIABLE>"),
//: Value when inserting a new variable
tr("<VALUE>")));
}
QModelIndex EnvironmentModel::addVariable(const Utils::EnvironmentItem &item)
QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
{
// Return existing index if the name is already in the result set:
@@ -331,7 +331,7 @@ void EnvironmentModel::unsetVariable(const QString &name)
emit userChangesChanged();
return;
}
Utils::EnvironmentItem item(name, QString());
EnvironmentItem item(name, QString());
item.unset = true;
d->m_items.append(item);
d->updateResultEnvironment();
@@ -353,12 +353,12 @@ bool EnvironmentModel::canReset(const QString &name)
return d->m_baseEnvironment.hasKey(name);
}
QList<Utils::EnvironmentItem> EnvironmentModel::userChanges() const
QList<EnvironmentItem> EnvironmentModel::userChanges() const
{
return d->m_items;
}
void EnvironmentModel::setUserChanges(QList<Utils::EnvironmentItem> list)
void EnvironmentModel::setUserChanges(QList<EnvironmentItem> list)
{
// We assume nobody is reordering the items here.
if (list == d->m_items)

View File

@@ -56,7 +56,7 @@ public:
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
QModelIndex addVariable();
QModelIndex addVariable(const Utils::EnvironmentItem &item);
QModelIndex addVariable(const EnvironmentItem &item);
void resetVariable(const QString &name);
void unsetVariable(const QString &name);
bool canUnset(const QString &name);
@@ -64,9 +64,9 @@ public:
QString indexToVariable(const QModelIndex &index) const;
QModelIndex variableToIndex(const QString &name) const;
bool changes(const QString &key) const;
void setBaseEnvironment(const Utils::Environment &env);
QList<Utils::EnvironmentItem> userChanges() const;
void setUserChanges(QList<Utils::EnvironmentItem> list);
void setBaseEnvironment(const Environment &env);
QList<EnvironmentItem> userChanges() const;
void setUserChanges(QList<EnvironmentItem> list);
signals:
void userChangesChanged();

View File

@@ -177,7 +177,7 @@ private:
void updateMargins();
void updateButtonPositions();
friend class Utils::FancyLineEditPrivate;
friend class FancyLineEditPrivate;
FancyLineEditPrivate *d;
};

View File

@@ -644,7 +644,7 @@ bool FileName::isChildOf(const FileName &s) const
/// \overload
bool FileName::isChildOf(const QDir &dir) const
{
return isChildOf(Utils::FileName::fromString(dir.absolutePath()));
return isChildOf(FileName::fromString(dir.absolutePath()));
}
/// \returns whether FileName endsWith \a s
@@ -659,7 +659,7 @@ bool FileName::endsWith(const QString &s) const
FileName FileName::relativeChildPath(const FileName &parent) const
{
if (!isChildOf(parent))
return Utils::FileName();
return FileName();
return FileName(QString::mid(parent.size() + 1, -1));
}

View File

@@ -80,10 +80,10 @@ public:
bool isChildOf(const QDir &dir) const;
bool endsWith(const QString &s) const;
Utils::FileName relativeChildPath(const FileName &parent) const;
Utils::FileName &appendPath(const QString &s);
Utils::FileName &appendString(const QString &str);
Utils::FileName &appendString(QChar str);
FileName relativeChildPath(const FileName &parent) const;
FileName &appendPath(const QString &s);
FileName &appendString(const QString &str);
FileName &appendString(QChar str);
using QString::size;
using QString::count;

View File

@@ -69,7 +69,7 @@ FileWizardPage::FileWizardPage(QWidget *parent) :
connect(d->m_ui.pathChooser, SIGNAL(returnPressed()), this, SLOT(slotActivated()));
connect(d->m_ui.nameLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated()));
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Location"));
setProperty(SHORT_TITLE_PROPERTY, tr("Location"));
}
FileWizardPage::~FileWizardPage()

View File

@@ -90,7 +90,7 @@ bool IpAddressLineEdit::validate(const QString &value, QString *errorMessage) co
void IpAddressLineEdit::handleChanged(const QString &t)
{
Utils::FancyLineEdit::handleChanged(t);
FancyLineEdit::handleChanged(t);
if (isValid())
emit validAddressChanged(t);
else

View File

@@ -36,7 +36,7 @@ namespace Utils {
class IpAddressLineEditPrivate;
class QTCREATOR_UTILS_EXPORT IpAddressLineEdit : public Utils::FancyLineEdit
class QTCREATOR_UTILS_EXPORT IpAddressLineEdit : public FancyLineEdit
{
Q_OBJECT

View File

@@ -398,22 +398,22 @@ public:
JsonSchemaManager(const QStringList &searchPaths);
~JsonSchemaManager();
Utils::JsonSchema *schemaForFile(const QString &fileName) const;
Utils::JsonSchema *schemaByName(const QString &baseName) const;
JsonSchema *schemaForFile(const QString &fileName) const;
JsonSchema *schemaByName(const QString &baseName) const;
private:
struct JsonSchemaData
{
JsonSchemaData(const QString &absoluteFileName, Utils::JsonSchema *schema = 0)
JsonSchemaData(const QString &absoluteFileName, JsonSchema *schema = 0)
: m_absoluteFileName(absoluteFileName)
, m_schema(schema)
{}
QString m_absoluteFileName;
Utils::JsonSchema *m_schema;
JsonSchema *m_schema;
QDateTime m_lastParseAttempt;
};
Utils::JsonSchema *parseSchema(const QString &schemaFileName) const;
JsonSchema *parseSchema(const QString &schemaFileName) const;
QStringList m_searchPaths;
mutable QHash<QString, JsonSchemaData> m_schemas;

View File

@@ -36,7 +36,7 @@
namespace Utils {
class QTCREATOR_UTILS_EXPORT NavigationTreeView : public Utils::TreeView
class QTCREATOR_UTILS_EXPORT NavigationTreeView : public TreeView
{
Q_OBJECT
public:

View File

@@ -148,7 +148,7 @@ QString BinaryVersionToolTipEventFilter::toolVersion(const QString &binary, cons
if (!proc.waitForStarted())
return QString();
if (!proc.waitForFinished()) {
Utils::SynchronousProcess::stopProcess(proc);
SynchronousProcess::stopProcess(proc);
return QString();
}
return QString::fromLocal8Bit(QByteArray(proc.readAllStandardOutput()
@@ -271,7 +271,7 @@ void PathChooser::insertButton(int index, const QString &text, QObject *receiver
d->m_buttons.insert(index, button);
}
QString Utils::PathChooser::browseButtonLabel()
QString PathChooser::browseButtonLabel()
{
return HostOsInfo::isMacHost() ? tr("Choose...") : tr("Browse...");
}
@@ -296,7 +296,7 @@ void PathChooser::setBaseDirectory(const QString &directory)
FileName PathChooser::baseFileName() const
{
return Utils::FileName::fromString(d->m_baseDirectory);
return FileName::fromString(d->m_baseDirectory);
}
void PathChooser::setBaseFileName(const FileName &base)
@@ -305,7 +305,7 @@ void PathChooser::setBaseFileName(const FileName &base)
triggerChanged();
}
void PathChooser::setEnvironment(const Utils::Environment &env)
void PathChooser::setEnvironment(const Environment &env)
{
QString oldExpand = path();
d->m_environment = env;
@@ -327,7 +327,7 @@ QString PathChooser::rawPath() const
FileName PathChooser::fileName() const
{
return Utils::FileName::fromString(path());
return FileName::fromString(path());
}
void PathChooser::setPath(const QString &path)
@@ -335,7 +335,7 @@ void PathChooser::setPath(const QString &path)
d->m_lineEdit->setText(QDir::toNativeSeparators(path));
}
void PathChooser::setFileName(const Utils::FileName &fn)
void PathChooser::setFileName(const FileName &fn)
{
d->m_lineEdit->setText(fn.toUserOutput());
}

View File

@@ -94,15 +94,15 @@ public:
QString path() const;
QString rawPath() const; // The raw unexpanded input.
Utils::FileName fileName() const;
FileName fileName() const;
QString baseDirectory() const;
void setBaseDirectory(const QString &directory);
Utils::FileName baseFileName() const;
void setBaseFileName(const Utils::FileName &base);
FileName baseFileName() const;
void setBaseFileName(const FileName &base);
void setEnvironment(const Utils::Environment &env);
void setEnvironment(const Environment &env);
/** Returns the suggested label title when used in a form layout. */
static QString label();

View File

@@ -350,7 +350,7 @@ QVariantMap PersistentSettingsReader::restoreValues() const
return m_valueMap;
}
bool PersistentSettingsReader::load(const Utils::FileName &fileName)
bool PersistentSettingsReader::load(const FileName &fileName)
{
m_valueMap.clear();
@@ -442,7 +442,7 @@ bool PersistentSettingsWriter::write(const QVariantMap &data, QWidget *parent) c
{
QDir tmp;
tmp.mkpath(m_fileName.toFileInfo().path());
Utils::FileSaver saver(m_fileName.toString(), QIODevice::Text);
FileSaver saver(m_fileName.toString(), QIODevice::Text);
if (!saver.hasError()) {
const Context ctx;
QXmlStreamWriter w(saver.file());

View File

@@ -60,12 +60,12 @@ public:
bool save(const QVariantMap &data, QWidget *parent) const;
Utils::FileName fileName() const;
FileName fileName() const;
private:
bool write(const QVariantMap &data, QWidget *parent) const;
const Utils::FileName m_fileName;
const FileName m_fileName;
const QString m_docType;
mutable QMap<QString, QVariant> m_savedData;
};

View File

@@ -34,9 +34,9 @@
#include <QMessageBox>
#include <QPushButton>
using namespace Utils;
namespace Utils {
QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer Utils::reloadPrompt(const QString &fileName,
QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &fileName,
bool modified,
QWidget *parent)
{
@@ -56,7 +56,7 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer Utils::reloadPrompt(const QStri
return reloadPrompt(title, msg, QDir::toNativeSeparators(fileName), parent);
}
QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer Utils::reloadPrompt(const QString &title,
QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title,
const QString &prompt,
const QString &details,
QWidget *parent)
@@ -84,8 +84,8 @@ QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer Utils::reloadPrompt(const QStri
return ReloadNone;
}
QTCREATOR_UTILS_EXPORT Utils::FileDeletedPromptAnswer
Utils::fileDeletedPrompt(const QString &fileName, bool triggerExternally, QWidget *parent)
QTCREATOR_UTILS_EXPORT FileDeletedPromptAnswer
fileDeletedPrompt(const QString &fileName, bool triggerExternally, QWidget *parent)
{
const QString title = QCoreApplication::translate("Utils::fileDeletedPrompt",
"File has been removed");
@@ -127,3 +127,5 @@ QTCREATOR_UTILS_EXPORT Utils::FileDeletedPromptAnswer
return FileDeletedSave;
return FileDeletedClose;
}
} // namespace Utils

View File

@@ -270,9 +270,9 @@ void TcpPortsGatherer::update(QAbstractSocket::NetworkLayerProtocol protocol)
d->protocol = protocol;
d->usedPorts.clear();
if (Utils::HostOsInfo::isWindowsHost())
if (HostOsInfo::isWindowsHost())
d->updateWin();
else if (Utils::HostOsInfo::isLinuxHost())
else if (HostOsInfo::isLinuxHost())
d->updateLinux();
else
d->updateNetstat();

View File

@@ -213,7 +213,7 @@ TextFileFormat::ReadResult readTextFile(const QString &fileName, const QTextCode
QByteArray data;
try {
Utils::FileReader reader;
FileReader reader;
if (!reader.fetch(fileName, errorString))
return TextFileFormat::ReadIOError;
data = reader.data();
@@ -277,16 +277,16 @@ TextFileFormat::ReadResult TextFileFormat::readFileUTF8(const QString &fileName,
{
QByteArray data;
try {
Utils::FileReader reader;
FileReader reader;
if (!reader.fetch(fileName, errorString))
return Utils::TextFileFormat::ReadIOError;
return TextFileFormat::ReadIOError;
data = reader.data();
} catch (const std::bad_alloc &) {
*errorString = QCoreApplication::translate("Utils::TextFileFormat", "Out of memory.");
return Utils::TextFileFormat::ReadMemoryAllocationError;
return TextFileFormat::ReadMemoryAllocationError;
}
Utils::TextFileFormat format = Utils::TextFileFormat::detect(data);
TextFileFormat format = TextFileFormat::detect(data);
if (!format.codec)
format.codec = defaultCodec ? defaultCodec : QTextCodec::codecForLocale();
QString target;
@@ -294,10 +294,10 @@ TextFileFormat::ReadResult TextFileFormat::readFileUTF8(const QString &fileName,
if (format.hasUtf8Bom)
data.remove(0, 3);
*plainText = data;
return Utils::TextFileFormat::ReadSuccess;
return TextFileFormat::ReadSuccess;
}
*plainText = target.toUtf8();
return Utils::TextFileFormat::ReadSuccess;
return TextFileFormat::ReadSuccess;
}
/*!
@@ -318,7 +318,7 @@ bool TextFileFormat::writeFile(const QString &fileName, QString plainText, QStri
plainText.replace(QLatin1Char('\n'), QLatin1String("\r\n"));
}
Utils::FileSaver saver(fileName, fileMode);
FileSaver saver(fileName, fileMode);
if (!saver.hasError()) {
if (hasUtf8Bom && codec->name() == "UTF-8")
saver.write("\xef\xbb\xbf", 3);

View File

@@ -51,7 +51,7 @@ inline int screenNumber(const QPoint &pos, QWidget *w)
inline QRect screenGeometry(const QPoint &pos, QWidget *w)
{
if (Utils::HostOsInfo::isMacHost())
if (HostOsInfo::isMacHost())
return QApplication::desktop()->availableGeometry(screenNumber(pos, w));
return QApplication::desktop()->screenGeometry(screenNumber(pos, w));
}

View File

@@ -72,7 +72,7 @@ QTipLabel::QTipLabel(QWidget *parent) :
QTipLabel::~QTipLabel()
{
Utils::TipContent *tmpTipContent = m_tipContent;
TipContent *tmpTipContent = m_tipContent;
m_tipContent = 0;
delete tmpTipContent;
}
@@ -84,7 +84,7 @@ bool QTipLabel::isInteractive() const
void QTipLabel::setContent(const TipContent &content)
{
Utils::TipContent *tmpTipContent = m_tipContent;
TipContent *tmpTipContent = m_tipContent;
m_tipContent = content.clone();
delete tmpTipContent;
}

View File

@@ -53,16 +53,16 @@ protected:
public:
virtual ~QTipLabel();
void setContent(const Utils::TipContent &content);
const Utils::TipContent &content() const;
void setContent(const TipContent &content);
const TipContent &content() const;
virtual void configure(const QPoint &pos, QWidget *w) = 0;
virtual bool canHandleContentReplacement(const Utils::TipContent &content) const = 0;
virtual bool canHandleContentReplacement(const TipContent &content) const = 0;
bool isInteractive() const;
private:
Utils::TipContent *m_tipContent;
TipContent *m_tipContent;
};
class ColorTip : public QTipLabel

View File

@@ -222,7 +222,7 @@ void ToolTip::placeTip(const QPoint &pos, QWidget *w)
{
QRect screen = Internal::screenGeometry(pos, w);
QPoint p = pos;
p += QPoint(2, Utils::HostOsInfo::isWindowsHost() ? 21 : 16);
p += QPoint(2, HostOsInfo::isWindowsHost() ? 21 : 16);
if (p.x() + m_tip->width() > screen.x() + screen.width())
p.rx() -= 4 + m_tip->width();
if (p.y() + m_tip->height() > screen.y() + screen.height())

View File

@@ -326,7 +326,7 @@ Wizard::Wizard(QWidget *parent, Qt::WindowFlags flags) :
setOption(QWizard::NoBackButtonOnStartPage, true);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
if (Utils::HostOsInfo::isMacHost()) {
if (HostOsInfo::isMacHost()) {
setButtonLayout(QList<QWizard::WizardButton>()
<< QWizard::CancelButton
<< QWizard::Stretch