[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.
This commit is contained in:
parent
eaba696173
commit
8d0f076591
@ -20,7 +20,6 @@ set( libSources
|
|||||||
Settings.cpp
|
Settings.cpp
|
||||||
)
|
)
|
||||||
set( utilsSources
|
set( utilsSources
|
||||||
utils/CalamaresUtils.cpp
|
|
||||||
utils/CalamaresUtilsSystem.cpp
|
utils/CalamaresUtilsSystem.cpp
|
||||||
utils/CommandList.cpp
|
utils/CommandList.cpp
|
||||||
utils/Dirs.cpp
|
utils/Dirs.cpp
|
||||||
@ -28,6 +27,7 @@ set( utilsSources
|
|||||||
utils/Logger.cpp
|
utils/Logger.cpp
|
||||||
utils/PluginFactory.cpp
|
utils/PluginFactory.cpp
|
||||||
utils/Retranslator.cpp
|
utils/Retranslator.cpp
|
||||||
|
utils/String.cpp
|
||||||
utils/Variant.cpp
|
utils/Variant.cpp
|
||||||
utils/Yaml.cpp
|
utils/Yaml.cpp
|
||||||
)
|
)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "PythonHelper.h"
|
#include "PythonHelper.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/CalamaresUtilsSystem.h"
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
#include "utils/CalamaresUtils.h"
|
#include "utils/String.h"
|
||||||
|
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
|
@ -22,14 +22,16 @@
|
|||||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CalamaresUtils.h"
|
#include "String.h"
|
||||||
|
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
namespace CalamaresUtils
|
namespace CalamaresUtils
|
||||||
{
|
{
|
||||||
QString
|
QString
|
||||||
removeDiacritics( const QString& string )
|
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",
|
"S", "OE", "Z", "s", "oe", "z", "Y", "Y", "u", "A",
|
||||||
"A", "A", "A", "A", "AA", "AE", "C", "E", "E", "E",
|
"A", "A", "A", "A", "AA", "AE", "C", "E", "E", "E",
|
||||||
"E", "I", "I", "I", "I", "D", "N", "O", "O", "O",
|
"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/>.
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTILS_CALAMARESUTILS_H
|
#ifndef UTILS_STRING_H
|
||||||
#define UTILS_CALAMARESUTILS_H
|
#define UTILS_STRING_H
|
||||||
|
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include <QLocale>
|
#include <QString>
|
||||||
|
|
||||||
class QDir;
|
|
||||||
class QObject;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The CalamaresUtils namespace contains utility functions.
|
* @brief The CalamaresUtils namespace contains utility functions.
|
@ -21,7 +21,6 @@
|
|||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
|
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "utils/CalamaresUtils.h"
|
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
#include "utils/ImageRegistry.h"
|
#include "utils/ImageRegistry.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef CALAMARESUTILSGUI_H
|
#ifndef CALAMARESUTILSGUI_H
|
||||||
#define CALAMARESUTILSGUI_H
|
#define CALAMARESUTILSGUI_H
|
||||||
|
|
||||||
#include "utils/CalamaresUtils.h"
|
|
||||||
#include "UiDllMacro.h"
|
#include "UiDllMacro.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "DebugWindow.h"
|
#include "DebugWindow.h"
|
||||||
#include "utils/CalamaresUtils.h"
|
|
||||||
#include "utils/Retranslator.h"
|
#include "utils/Retranslator.h"
|
||||||
#include "utils/qjsonmodel.h"
|
#include "utils/qjsonmodel.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#include "PythonQtUtilsWrapper.h"
|
#include "PythonQtUtilsWrapper.h"
|
||||||
|
|
||||||
#include "utils/CalamaresUtilsSystem.h"
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
#include "utils/CalamaresUtils.h"
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/String.h"
|
||||||
|
|
||||||
#include <PythonQt.h>
|
#include <PythonQt.h>
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
|
|
||||||
#include "utils/CalamaresUtils.h"
|
|
||||||
#include "utils/CalamaresUtilsSystem.h"
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
#include "utils/CommandList.h"
|
#include "utils/CommandList.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
@ -113,7 +112,7 @@ copy_file( const QString& source, const QString& dest )
|
|||||||
|
|
||||||
sourcef.close();
|
sourcef.close();
|
||||||
destf.close();
|
destf.close();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,22 +150,22 @@ Calamares::JobResult PreserveFiles::exec()
|
|||||||
if ( it.perm.isValid() )
|
if ( it.perm.isValid() )
|
||||||
{
|
{
|
||||||
auto s_p = CalamaresUtils::System::instance();
|
auto s_p = CalamaresUtils::System::instance();
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = s_p->targetEnvCall( QStringList{ "chown", it.perm.username(), bare_dest } );
|
r = s_p->targetEnvCall( QStringList{ "chown", it.perm.username(), bare_dest } );
|
||||||
if ( r )
|
if ( r )
|
||||||
cWarning() << "Could not chown target" << bare_dest;
|
cWarning() << "Could not chown target" << bare_dest;
|
||||||
|
|
||||||
r = s_p->targetEnvCall( QStringList{ "chgrp", it.perm.group(), bare_dest } );
|
r = s_p->targetEnvCall( QStringList{ "chgrp", it.perm.group(), bare_dest } );
|
||||||
if ( r )
|
if ( r )
|
||||||
cWarning() << "Could not chgrp target" << bare_dest;
|
cWarning() << "Could not chgrp target" << bare_dest;
|
||||||
|
|
||||||
r = s_p->targetEnvCall( QStringList{ "chmod", it.perm.octal(), bare_dest } );
|
r = s_p->targetEnvCall( QStringList{ "chmod", it.perm.octal(), bare_dest } );
|
||||||
if ( r )
|
if ( r )
|
||||||
cWarning() << "Could not chmod target" << bare_dest;
|
cWarning() << "Could not chmod target" << bare_dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,7 +194,7 @@ void PreserveFiles::setConfigurationMap(const QVariantMap& configurationMap)
|
|||||||
QString defaultPermissions = configurationMap[ "perm" ].toString();
|
QString defaultPermissions = configurationMap[ "perm" ].toString();
|
||||||
if ( defaultPermissions.isEmpty() )
|
if ( defaultPermissions.isEmpty() )
|
||||||
defaultPermissions = QStringLiteral( "root:root:0400" );
|
defaultPermissions = QStringLiteral( "root:root:0400" );
|
||||||
|
|
||||||
QVariantList l = files.toList();
|
QVariantList l = files.toList();
|
||||||
unsigned int c = 0;
|
unsigned int c = 0;
|
||||||
for ( const auto& li : l )
|
for ( const auto& li : l )
|
||||||
|
@ -23,17 +23,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "UsersPage.h"
|
#include "UsersPage.h"
|
||||||
|
|
||||||
#include "ui_page_usersetup.h"
|
#include "ui_page_usersetup.h"
|
||||||
|
|
||||||
#include "CreateUserJob.h"
|
#include "CreateUserJob.h"
|
||||||
#include "SetPasswordJob.h"
|
#include "SetPasswordJob.h"
|
||||||
#include "SetHostNameJob.h"
|
#include "SetHostNameJob.h"
|
||||||
#include "JobQueue.h"
|
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "utils/Logger.h"
|
#include "JobQueue.h"
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
|
||||||
#include "utils/Retranslator.h"
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/Retranslator.h"
|
||||||
|
#include "utils/String.h"
|
||||||
|
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
Loading…
Reference in New Issue
Block a user