Make const string (arrays) really const

"const char *x" is still a variable just pointing to const chars,
x = anotherconststring; still possible
"const char x[]" or "const char * const x" is a const itself,
x = anotherconststring; no longer possible and one indirection less when
accessing the data
parent c548029b
......@@ -32,8 +32,8 @@
#include "kis_serializable_configuration.h"
const char* KisBookmarkedConfigurationManager::ConfigDefault = "Default";
const char* KisBookmarkedConfigurationManager::ConfigLastUsed = "Last Used";
const char* const KisBookmarkedConfigurationManager::ConfigDefault = "Default";
const char* const KisBookmarkedConfigurationManager::ConfigLastUsed = "Last Used";
struct KisBookmarkedConfigurationManager::Private {
......
......@@ -32,8 +32,8 @@ class KLocalizedString;
class KRITAIMAGE_EXPORT KisBookmarkedConfigurationManager
{
public:
static const char* ConfigDefault;
static const char* ConfigLastUsed;
static const char* const ConfigDefault;
static const char* const ConfigLastUsed;
public:
/**
* @param configEntryGroup name of the configuration entry with the
......
......@@ -57,7 +57,7 @@
#include <kross/core/manager.h>
//! Also add public method for runtime?
const char* ns = "http://kexi-project.org/report/2.0";
const char ns[] = "http://kexi-project.org/report/2.0";
static QDomElement propertyToElement(QDomDocument* d, KoProperty::Property* p)
{
......
......@@ -64,9 +64,9 @@ struct KoEncryptedStore_EncryptionData {
// TODO: Discuss autosaving and password/leakage-problem (currently: hardcoded no autosave)
namespace
{
const char* MANIFEST_FILE = "META-INF/manifest.xml";
const char* META_FILE = "meta.xml";
const char* THUMBNAIL_FILE = "Thumbnails/thumbnail.png";
const char MANIFEST_FILE[] = "META-INF/manifest.xml";
const char META_FILE[] = "meta.xml";
const char THUMBNAIL_FILE[] = "Thumbnails/thumbnail.png";
}
KoEncryptedStore::KoEncryptedStore(const QString & filename, Mode mode,
......
......@@ -21,7 +21,7 @@
#include "KoZoomMode.h"
#include <klocale.h>
const char* KoZoomMode::modes[] =
const char* const KoZoomMode::modes[] =
{
I18N_NOOP("%1%"),
I18N_NOOP("Fit Page Width"),
......
......@@ -96,7 +96,7 @@ public:
static void setMaximumZoom(qreal zoom);
private:
static const char * modes[];
static const char * const modes[];
static qreal minimumZoomValue;
static qreal maximumZoomValue;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment