Skip to content

Commit

Permalink
Removed the "Internal" namespace
Browse files Browse the repository at this point in the history
Never seen noticed any benefit from it, so good riddance!

I kept it only for two classes in libtiled, which use the "Internal"
namespace to separate a private class.

This change will affect the context of many translatable strings, but
this mostly just causes them to be marked as "unfinished" since they are
still matched by heuristic.
  • Loading branch information
bjorn committed Dec 19, 2018
1 parent 7fb9289 commit 71c1de5
Show file tree
Hide file tree
Showing 420 changed files with 102 additions and 885 deletions.
2 changes: 1 addition & 1 deletion src/libtiled/mapreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Map;

namespace Internal {
class MapReaderPrivate;
}
} // namespace Internal

/**
* A fast QXmlStreamReader based reader for the TMX and TSX formats.
Expand Down
2 changes: 1 addition & 1 deletion src/libtiled/mapwriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Tileset;

namespace Internal {
class MapWriterPrivate;
}
} // namespace Internal

/**
* A QXmlStreamWriter based writer for the TMX and TSX formats.
Expand Down
2 changes: 1 addition & 1 deletion src/libtiled/templatemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ inline ObjectTemplate *TemplateManager::findObjectTemplate(const QString &fileNa
return mObjectTemplates.value(fileName);
}

} // namespace Tiled::Internal
} // namespace Tiled
2 changes: 1 addition & 1 deletion src/tiled/aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <cmath>

using namespace Tiled::Internal;
using namespace Tiled;

AboutDialog::AboutDialog(QWidget *parent): QDialog(parent)
{
Expand Down
2 changes: 0 additions & 2 deletions src/tiled/aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "ui_aboutdialog.h"

namespace Tiled {
namespace Internal {

class AboutDialog : public QDialog, private Ui::AboutDialog
{
Expand All @@ -38,5 +37,4 @@ private slots:
void donate();
};

} // namespace Internal
} // namespace Tiled
19 changes: 9 additions & 10 deletions src/tiled/abstractobjecttool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#include <QtMath>

using namespace Tiled;
using namespace Tiled::Internal;

static bool isTileObject(MapObject *mapObject)
{
Expand Down Expand Up @@ -175,13 +174,13 @@ void AbstractObjectTool::languageChanged()
{
mFlipHorizontal->setToolTip(tr("Flip Horizontally"));
mFlipVertical->setToolTip(tr("Flip Vertically"));
mRotateLeft->setToolTip(QCoreApplication::translate("Tiled::Internal::StampActions", "Rotate Left"));
mRotateRight->setToolTip(QCoreApplication::translate("Tiled::Internal::StampActions", "Rotate Right"));
mRotateLeft->setToolTip(QCoreApplication::translate("Tiled::StampActions", "Rotate Left"));
mRotateRight->setToolTip(QCoreApplication::translate("Tiled::StampActions", "Rotate Right"));

mFlipHorizontal->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::Internal::StampActions", "X")));
mFlipVertical->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::Internal::StampActions", "Y")));
mRotateLeft->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::Internal::StampActions", "Shift+Z")));
mRotateRight->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::Internal::StampActions", "Z")));
mFlipHorizontal->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::StampActions", "X")));
mFlipVertical->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::StampActions", "Y")));
mRotateLeft->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::StampActions", "Shift+Z")));
mRotateRight->setShortcut(QKeySequence(QCoreApplication::translate("Tiled::StampActions", "Z")));
}

void AbstractObjectTool::populateToolBar(QToolBar *toolBar)
Expand Down Expand Up @@ -281,12 +280,12 @@ static QString saveObjectTemplate(const MapObject *mapObject)
if (!mapObject->name().isEmpty())
suggestedFileName += mapObject->name();
else
suggestedFileName += QCoreApplication::translate("Tiled::Internal::MainWindow", "untitled");
suggestedFileName += QCoreApplication::translate("Tiled::MainWindow", "untitled");
suggestedFileName += QLatin1String(".tx");

QWidget *parent = DocumentManager::instance()->widget()->window();
QString fileName = QFileDialog::getSaveFileName(parent,
QCoreApplication::translate("Tiled::Internal::MainWindow", "Save Template"),
QCoreApplication::translate("Tiled::MainWindow", "Save Template"),
suggestedFileName,
filter,
&selectedFilter);
Expand All @@ -300,7 +299,7 @@ static QString saveObjectTemplate(const MapObject *mapObject)
objectTemplate.setObject(mapObject);

if (!format->write(&objectTemplate, fileName)) {
QMessageBox::critical(nullptr, QCoreApplication::translate("Tiled::Internal::MainWindow", "Error Saving Template"),
QMessageBox::critical(nullptr, QCoreApplication::translate("Tiled::MainWindow", "Error Saving Template"),
format->errorString());
return QString();
}
Expand Down
3 changes: 0 additions & 3 deletions src/tiled/abstractobjecttool.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ namespace Tiled {
class MapObject;
class ObjectGroup;

namespace Internal {

class MapObjectItem;

/**
Expand Down Expand Up @@ -106,5 +104,4 @@ private slots:
QAction *mRotateRight;
};

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/abstracttilefilltool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <QAction>

using namespace Tiled;
using namespace Internal;

AbstractTileFillTool::AbstractTileFillTool(const QString &name,
const QIcon &icon,
Expand Down
3 changes: 0 additions & 3 deletions src/tiled/abstracttilefilltool.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ namespace Tiled {

class WangSet;

namespace Internal {

class MapDocument;
class StampActions;
class WangFiller;
Expand Down Expand Up @@ -141,5 +139,4 @@ inline bool AbstractTileFillTool::isCapturing() const
return mCaptureStampHelper.isActive();
}

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/abstracttileselectiontool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <QToolBar>

using namespace Tiled;
using namespace Tiled::Internal;

AbstractTileSelectionTool::AbstractTileSelectionTool(const QString &name,
const QIcon &icon,
Expand Down
2 changes: 0 additions & 2 deletions src/tiled/abstracttileselectiontool.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class QAction;
class QActionGroup;

namespace Tiled {
namespace Internal {

class MapDocument;

Expand Down Expand Up @@ -78,5 +77,4 @@ class AbstractTileSelectionTool : public AbstractTileTool
QActionGroup *mActionGroup;
};

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/abstracttiletool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <QtMath>

using namespace Tiled;
using namespace Tiled::Internal;

AbstractTileTool::AbstractTileTool(const QString &name,
const QIcon &icon,
Expand Down
3 changes: 0 additions & 3 deletions src/tiled/abstracttiletool.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ namespace Tiled {

class TileLayer;

namespace Internal {

class BrushItem;
class MapDocument;
class TileStamp;
Expand Down Expand Up @@ -130,5 +128,4 @@ class AbstractTileTool : public AbstractTool
bool mBrushVisible;
};

} // namespace Internal
} // namespace Tiled
2 changes: 0 additions & 2 deletions src/tiled/abstracttool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <QKeyEvent>

namespace Tiled {
namespace Internal {

AbstractTool::AbstractTool(const QString &name, const QIcon &icon,
const QKeySequence &shortcut, QObject *parent)
Expand Down Expand Up @@ -127,5 +126,4 @@ Layer *AbstractTool::currentLayer() const
return mMapDocument ? mMapDocument->currentLayer() : nullptr;
}

} // namespace Internal
} // namespace Tiled
5 changes: 1 addition & 4 deletions src/tiled/abstracttool.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class Layer;
class Tile;
class ObjectTemplate;

namespace Internal {

class MapDocument;
class MapScene;
class ToolManager;
Expand Down Expand Up @@ -260,7 +258,6 @@ inline ToolManager *AbstractTool::toolManager() const
return mToolManager;
}

} // namespace Internal
} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::Internal::AbstractTool*)
Q_DECLARE_METATYPE(Tiled::AbstractTool*)
2 changes: 0 additions & 2 deletions src/tiled/actionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <QHash>

namespace Tiled {
namespace Internal {

class ActionManagerPrivate
{
Expand Down Expand Up @@ -65,5 +64,4 @@ QAction *ActionManager::findAction(Id id)
return d->mIdToAction.value(id);
}

} // namespace Internal
} // namespace Tiled
4 changes: 1 addition & 3 deletions src/tiled/actionmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
class QAction;

namespace Tiled {
namespace Internal {

class MainWindow;

Expand All @@ -51,8 +50,7 @@ class ActionManager : public QObject
explicit ActionManager(QObject *parent = nullptr);
~ActionManager();

friend class Tiled::Internal::MainWindow; // creation
friend class Tiled::MainWindow; // creation
};

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/addpropertydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <QSettings>

using namespace Tiled;
using namespace Tiled::Internal;

static const char * const TYPE_KEY = "AddPropertyDialog/PropertyType";

Expand Down
2 changes: 0 additions & 2 deletions src/tiled/addremovelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <QCoreApplication>

namespace Tiled {
namespace Internal {

AddRemoveLayer::AddRemoveLayer(MapDocument *mapDocument,
int index,
Expand Down Expand Up @@ -83,5 +82,4 @@ RemoveLayer::RemoveLayer(MapDocument *mapDocument,
setText(QCoreApplication::translate("Undo Commands", "Remove Layer"));
}

} // namespace Internal
} // namespace Tiled
3 changes: 0 additions & 3 deletions src/tiled/addremovelayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ namespace Tiled {
class GroupLayer;
class Layer;

namespace Internal {

class MapDocument;

/**
Expand Down Expand Up @@ -98,5 +96,4 @@ class RemoveLayer : public AddRemoveLayer
{ removeLayer(); }
};

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/addremovemapobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "qtcompat_p.h"

using namespace Tiled;
using namespace Tiled::Internal;

AddRemoveMapObjects::AddRemoveMapObjects(MapDocument *mapDocument,
const QVector<Entry> &entries,
Expand Down
3 changes: 0 additions & 3 deletions src/tiled/addremovemapobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ namespace Tiled {
class MapObject;
class ObjectGroup;

namespace Internal {

class MapDocument;

/**
Expand Down Expand Up @@ -103,5 +101,4 @@ class RemoveMapObjects : public AddRemoveMapObjects
void redo() override;
};

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/addremoveterrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <QCoreApplication>

using namespace Tiled;
using namespace Tiled::Internal;

AddRemoveTerrain::AddRemoveTerrain(TilesetDocument *tilesetDocument,
int index,
Expand Down
3 changes: 0 additions & 3 deletions src/tiled/addremoveterrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ namespace Tiled {
class Terrain;
class Tileset;

namespace Internal {

class TilesetDocument;

/**
Expand Down Expand Up @@ -78,5 +76,4 @@ class RemoveTerrain : public AddRemoveTerrain
void redo() override { removeTerrain(); }
};

} // namespace Internal
} // namespace Tiled
2 changes: 0 additions & 2 deletions src/tiled/addremovetiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <QCoreApplication>

namespace Tiled {
namespace Internal {

AddRemoveTiles::AddRemoveTiles(TilesetDocument *tilesetDocument,
const QList<Tile *> &tiles,
Expand Down Expand Up @@ -71,5 +70,4 @@ RemoveTiles::RemoveTiles(TilesetDocument *tilesetDocument,
setText(QCoreApplication::translate("Undo Commands", "Remove Tiles"));
}

} // namespace Internal
} // namespace Tiled
3 changes: 0 additions & 3 deletions src/tiled/addremovetiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ namespace Tiled {

class Tile;

namespace Internal {

class TilesetDocument;

/**
Expand Down Expand Up @@ -84,5 +82,4 @@ class RemoveTiles : public AddRemoveTiles
{ removeTiles(); }
};

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/addremovetileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "mapdocument.h"

using namespace Tiled;
using namespace Tiled::Internal;

AddRemoveTileset::AddRemoveTileset(MapDocument *mapDocument,
int index,
Expand Down
2 changes: 0 additions & 2 deletions src/tiled/addremovetileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <QUndoCommand>

namespace Tiled {
namespace Internal {

class MapDocument;

Expand Down Expand Up @@ -86,5 +85,4 @@ class RemoveTileset : public AddRemoveTileset
{ removeTileset(); }
};

} // namespace Internal
} // namespace Tiled
1 change: 0 additions & 1 deletion src/tiled/addremovewangset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <QCoreApplication>

using namespace Tiled;
using namespace Internal;

AddRemoveWangSet::AddRemoveWangSet(TilesetDocument *tilesetDocument,
int index,
Expand Down
Loading

0 comments on commit 71c1de5

Please sign in to comment.