[libcalamares] Rename CalamaresUtils -> String

- The only remaining functions in the file are string-related, so
   rename to match their purpose.
 - Drop this include file from most places, since they don't actually
   use the string functionality at all.
main
Adriaan de Groot 6 years ago
parent eaba696173
commit 8d0f076591

@ -20,7 +20,6 @@ set( libSources
Settings.cpp
)
set( utilsSources
utils/CalamaresUtils.cpp
utils/CalamaresUtilsSystem.cpp
utils/CommandList.cpp
utils/Dirs.cpp
@ -28,6 +27,7 @@ set( utilsSources
utils/Logger.cpp
utils/PluginFactory.cpp
utils/Retranslator.cpp
utils/String.cpp
utils/Variant.cpp
utils/Yaml.cpp
)

@ -22,7 +22,7 @@
#include "PythonHelper.h"
#include "utils/Logger.h"
#include "utils/CalamaresUtilsSystem.h"
#include "utils/CalamaresUtils.h"
#include "utils/String.h"
#include "GlobalStorage.h"
#include "JobQueue.h"

@ -22,14 +22,16 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CalamaresUtils.h"
#include "String.h"
#include <QStringList>
namespace CalamaresUtils
{
QString
removeDiacritics( const QString& string )
{
const QString diacriticLetters = QString::fromUtf8(
static const QString diacriticLetters = QString::fromUtf8(
"ŠŒŽšœžŸ¥µÀ"
"ÁÂÃÄÅÆÇÈÉÊ"
"ËÌÍÎÏÐÑÒÓÔ"
@ -46,7 +48,7 @@ removeDiacritics( const QString& string )
"ॹĘꣳŃńŚ"
"śŹźŻż"
);
const QStringList noDiacriticLetters = {
static const QStringList noDiacriticLetters = {
"S", "OE", "Z", "s", "oe", "z", "Y", "Y", "u", "A",
"A", "A", "A", "A", "AA", "AE", "C", "E", "E", "E",
"E", "I", "I", "I", "I", "D", "N", "O", "O", "O",

@ -22,15 +22,12 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UTILS_CALAMARESUTILS_H
#define UTILS_CALAMARESUTILS_H
#ifndef UTILS_STRING_H
#define UTILS_STRING_H
#include "DllMacro.h"
#include <QLocale>
class QDir;
class QObject;
#include <QString>
/**
* @brief The CalamaresUtils namespace contains utility functions.

@ -21,7 +21,6 @@
#include "Branding.h"
#include "GlobalStorage.h"
#include "utils/CalamaresUtils.h"
#include "utils/CalamaresUtilsGui.h"
#include "utils/ImageRegistry.h"
#include "utils/Logger.h"

@ -20,7 +20,6 @@
#ifndef CALAMARESUTILSGUI_H
#define CALAMARESUTILSGUI_H
#include "utils/CalamaresUtils.h"
#include "UiDllMacro.h"
#include <QObject>

@ -17,7 +17,6 @@
*/
#include "DebugWindow.h"
#include "utils/CalamaresUtils.h"
#include "utils/Retranslator.h"
#include "utils/qjsonmodel.h"
#include "JobQueue.h"

@ -19,8 +19,8 @@
#include "PythonQtUtilsWrapper.h"
#include "utils/CalamaresUtilsSystem.h"
#include "utils/CalamaresUtils.h"
#include "utils/Logger.h"
#include "utils/String.h"
#include <PythonQt.h>

@ -24,7 +24,6 @@
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "utils/CalamaresUtils.h"
#include "utils/CalamaresUtilsSystem.h"
#include "utils/CommandList.h"
#include "utils/Logger.h"
@ -113,7 +112,7 @@ copy_file( const QString& source, const QString& dest )
sourcef.close();
destf.close();
return true;
}
@ -151,22 +150,22 @@ Calamares::JobResult PreserveFiles::exec()
if ( it.perm.isValid() )
{
auto s_p = CalamaresUtils::System::instance();
int r;
r = s_p->targetEnvCall( QStringList{ "chown", it.perm.username(), bare_dest } );
if ( r )
cWarning() << "Could not chown target" << bare_dest;
r = s_p->targetEnvCall( QStringList{ "chgrp", it.perm.group(), bare_dest } );
if ( r )
cWarning() << "Could not chgrp target" << bare_dest;
r = s_p->targetEnvCall( QStringList{ "chmod", it.perm.octal(), bare_dest } );
if ( r )
cWarning() << "Could not chmod target" << bare_dest;
}
++count;
}
}
@ -195,7 +194,7 @@ void PreserveFiles::setConfigurationMap(const QVariantMap& configurationMap)
QString defaultPermissions = configurationMap[ "perm" ].toString();
if ( defaultPermissions.isEmpty() )
defaultPermissions = QStringLiteral( "root:root:0400" );
QVariantList l = files.toList();
unsigned int c = 0;
for ( const auto& li : l )

@ -23,16 +23,21 @@
*/
#include "UsersPage.h"
#include "ui_page_usersetup.h"
#include "CreateUserJob.h"
#include "SetPasswordJob.h"
#include "SetHostNameJob.h"
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "utils/Logger.h"
#include "JobQueue.h"
#include "Settings.h"
#include "utils/CalamaresUtilsGui.h"
#include "utils/Logger.h"
#include "utils/Retranslator.h"
#include "Settings.h"
#include "utils/String.h"
#include <QBoxLayout>
#include <QLabel>

Loading…
Cancel
Save