mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: remove overload for KGlobal::staticQString()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3239f8e4af
commit
c334b5b1b0
5 changed files with 5 additions and 35 deletions
|
@ -61,10 +61,10 @@ static QString cleanpath( const QString &_path, bool cleanDirSeparator, bool dec
|
|||
|
||||
if (decodeDots)
|
||||
{
|
||||
static const QString &encodedDot = KGlobal::staticQString("%2e");
|
||||
static const QString &encodedDot = KGlobal::staticQString(QLatin1String("%2e"));
|
||||
if (path.indexOf(encodedDot, 0, Qt::CaseInsensitive) != -1)
|
||||
{
|
||||
static const QString &encodedDOT = KGlobal::staticQString("%2E"); // Uppercase!
|
||||
static const QString &encodedDOT = KGlobal::staticQString(QLatin1String("%2E")); // Uppercase!
|
||||
path.replace(encodedDot, QString(QLatin1Char('.')));
|
||||
path.replace(encodedDOT, QString(QLatin1Char('.')));
|
||||
len = path.length();
|
||||
|
|
|
@ -260,17 +260,6 @@ void KGlobal::setLocale(KLocale *newLocale, CopyCatalogs copy)
|
|||
d->locale = newLocale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a static QString
|
||||
*
|
||||
* To be used inside functions(!) like:
|
||||
* static const QString &myString = KGlobal::staticQString("myText");
|
||||
*/
|
||||
const QString &KGlobal::staticQString(const char *str)
|
||||
{
|
||||
return staticQString(QLatin1String(str));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a static QString
|
||||
*
|
||||
|
|
|
@ -386,25 +386,6 @@ namespace KGlobal
|
|||
*/
|
||||
KDECORE_EXPORT mode_t umask();
|
||||
|
||||
/**
|
||||
* Creates a static QString.
|
||||
*
|
||||
* To be used inside functions(!) like:
|
||||
* @code
|
||||
* static const QString &myString = KGlobal::staticQString("myText");
|
||||
* @endcode
|
||||
*
|
||||
* @attention Do @b NOT use code such as:
|
||||
* @code
|
||||
* static QString myString = KGlobal::staticQString("myText");
|
||||
* @endcode
|
||||
* This creates a static object (instead of a static reference)
|
||||
* and as you know static objects are EVIL.
|
||||
* @param str the string to create
|
||||
* @return the static string
|
||||
*/
|
||||
KDECORE_EXPORT const QString& staticQString(const char *str); //krazy:exclude=constref (doesn't make sense otherwise)
|
||||
|
||||
/**
|
||||
* Creates a static QString.
|
||||
*
|
||||
|
|
|
@ -442,7 +442,7 @@ QString KMimeType::iconNameForUrl( const KUrl & _url, mode_t mode )
|
|||
if (!mt) {
|
||||
return QString();
|
||||
}
|
||||
static const QString& unknown = KGlobal::staticQString("unknown");
|
||||
static const QString& unknown = KGlobal::staticQString(QLatin1String("unknown"));
|
||||
const QString mimeTypeIcon = mt->iconName( _url );
|
||||
QString i = mimeTypeIcon;
|
||||
|
||||
|
@ -566,7 +566,7 @@ QStringList KMimeType::allParentMimeTypes() const
|
|||
QString KMimeType::defaultMimeType()
|
||||
{
|
||||
static const QString & s_strDefaultMimeType =
|
||||
KGlobal::staticQString( "application/octet-stream" );
|
||||
KGlobal::staticQString(QLatin1String("application/octet-stream"));
|
||||
return s_strDefaultMimeType;
|
||||
}
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ QString KStringHandler::from8Bit( const char *str )
|
|||
if (!str)
|
||||
return QString();
|
||||
if (!*str) {
|
||||
static const QString &emptyString = KGlobal::staticQString("");
|
||||
static const QString &emptyString = KGlobal::staticQString(QLatin1String(""));
|
||||
return emptyString;
|
||||
}
|
||||
return KStringHandler::isUtf8( str ) ?
|
||||
|
|
Loading…
Add table
Reference in a new issue