Commit 032618e3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to fix compile with "-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII"

svn path=/trunk/KDE/kdeutils/ark/; revision=1180383
parent 7aa47dc4
......@@ -76,15 +76,15 @@ void BatchExtract::addExtraction(Kerfuffle::Archive* archive)
d.mkdir(subfolderName);
destination += '/' + subfolderName;
destination += QLatin1Char( '/' ) + subfolderName;
}
Kerfuffle::ExtractionOptions options;
options["PreservePaths"] = preservePaths();
options[QLatin1String( "PreservePaths" )] = preservePaths();
Kerfuffle::ExtractJob *job = archive->copyFiles(QVariantList(), destination, options);
kDebug() << QString("Registering job from archive %1, to %2, preservePaths %3").arg(archive->fileName()).arg(destination).arg(preservePaths());
kDebug() << QString(QLatin1String( "Registering job from archive %1, to %2, preservePaths %3" )).arg(archive->fileName()).arg(destination).arg(preservePaths());
addSubjob(job);
......@@ -176,7 +176,7 @@ void BatchExtract::slotResult(KJob *job)
if (openDestinationAfterExtraction()) {
KUrl destination(destinationFolder());
destination.cleanPath();
KRun::runUrl(destination, "inode/directory", 0);
KRun::runUrl(destination, QLatin1String( "inode/directory" ), 0);
}
kDebug() << "Finished, emitting the result";
......
......@@ -86,7 +86,7 @@ int main(int argc, char **argv)
ki18n("bkisofs code"),
QByteArray(),
"http://littlesvr.ca/misc/contactandrew.php");
aboutData.setProgramIconName("utilities-file-archiver");
aboutData.setProgramIconName(QLatin1String( "utilities-file-archiver" ));
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineOptions option;
......
......@@ -53,7 +53,7 @@ static bool isValidArchiveDrag(const QMimeData *data)
MainWindow::MainWindow(QWidget *)
: KParts::MainWindow()
{
setXMLFile("arkui.rc");
setXMLFile(QLatin1String( "arkui.rc" ));
setupActions();
statusBar();
......@@ -61,7 +61,7 @@ MainWindow::MainWindow(QWidget *)
if (!initialGeometrySet()) {
resize(640, 480);
}
setAutoSaveSettings("MainWindow");
setAutoSaveSettings(QLatin1String( "MainWindow" ));
setAcceptDrops(true);
}
......@@ -118,7 +118,7 @@ void MainWindow::dragMoveEvent(QDragMoveEvent * event)
bool MainWindow::loadPart()
{
KPluginFactory *factory = KPluginLoader("arkpart").factory();
KPluginFactory *factory = KPluginLoader(QLatin1String( "arkpart" )).factory();
if (factory) {
m_part = static_cast<KParts::ReadWritePart*>(factory->create<KParts::ReadWritePart>(this));
}
......@@ -217,9 +217,9 @@ void MainWindow::openUrl(const KUrl& url)
void MainWindow::setShowExtractDialog(bool option)
{
if (option) {
m_openArgs.metaData()["showExtractDialog"] = "true";
m_openArgs.metaData()[QLatin1String( "showExtractDialog" )] = QLatin1String( "true" );
} else {
m_openArgs.metaData().remove("showExtractDialog");
m_openArgs.metaData().remove(QLatin1String( "showExtractDialog" ));
}
}
......@@ -239,10 +239,10 @@ void MainWindow::newArchive()
QString saveFile = KFileDialog::getSaveFileName(KUrl("kfiledialog:///ArkNewDir"),
mimeTypes.join( QLatin1String( " " )));
m_openArgs.metaData()["createNewArchive"] = "true";
m_openArgs.metaData()[QLatin1String( "createNewArchive" )] = QLatin1String( "true" );
openUrl(KUrl(saveFile));
m_openArgs.metaData().remove("showExtractDialog");
m_openArgs.metaData().remove("createNewArchive");
m_openArgs.metaData().remove(QLatin1String( "showExtractDialog" ));
m_openArgs.metaData().remove(QLatin1String( "createNewArchive" ));
}
......@@ -83,7 +83,7 @@ void AddDialog::loadConfiguration()
{
m_config = KConfigGroup(KGlobal::config()->group("AddDialog"));
const QString defaultMimeType = "application/x-compressed-tar";
const QString defaultMimeType = QLatin1String( "application/x-compressed-tar" );
const QStringList writeMimeTypes = Kerfuffle::supportedWriteMimeTypes();
const QString lastMimeType = m_config.readEntry("LastMimeType", defaultMimeType);
......
......@@ -80,7 +80,7 @@ bool AddToArchive::showAddDialog(void)
QPointer<Kerfuffle::AddDialog> dialog = new Kerfuffle::AddDialog(
m_inputs, // itemsToAdd
KUrl(m_firstPath), // startDir
"", // filter
QLatin1String( "" ), // filter
NULL, // parent
NULL); // widget
......@@ -135,7 +135,7 @@ void AddToArchive::slotStartJob(void)
Kerfuffle::Archive *archive;
if (!m_filename.isEmpty()) {
archive = Kerfuffle::factory(m_filename, m_mimeType);
kDebug() << "Set filename to " + m_filename;
kDebug() << "Set filename to " << m_filename;
} else {
if (m_autoFilenameSuffix.isEmpty()) {
KMessageBox::error(NULL, i18n("You need to either supply a filename for the archive or a suffix (such as rar, tar.gz) with the --autofilename argument."));
......@@ -152,21 +152,21 @@ void AddToArchive::slotStartJob(void)
base = fi.absoluteFilePath();
if (base.endsWith('/')) {
if (base.endsWith(QLatin1Char( '/' ))) {
base.chop(1);
}
QString finalName = base + '.' + m_autoFilenameSuffix;
QString finalName = base + QLatin1Char( '.' ) + m_autoFilenameSuffix;
//if file already exists, append a number to the base until it doesn't
//exist
int appendNumber = 0;
while (KStandardDirs::exists(finalName)) {
++appendNumber;
finalName = base + '_' + QString::number(appendNumber) + '.' + m_autoFilenameSuffix;
finalName = base + QLatin1Char( '_' ) + QString::number(appendNumber) + QLatin1Char( '.' ) + m_autoFilenameSuffix;
}
kDebug() << "Autoset filename to " + finalName;
kDebug() << "Autoset filename to "<< finalName;
archive = Kerfuffle::factory(finalName, m_mimeType);
}
......@@ -190,7 +190,7 @@ void AddToArchive::slotStartJob(void)
m_inputs[i] = stripDir.absoluteFilePath(m_inputs.at(i));
}
options["GlobalWorkDir"] = stripDir.path();
options[QLatin1String( "GlobalWorkDir" )] = stripDir.path();
kDebug() << "Setting GlobalWorkDir to " << stripDir.path();
}
......
......@@ -40,7 +40,7 @@
static bool comparePlugins(const KService::Ptr &p1, const KService::Ptr &p2)
{
return (p1->property("X-KDE-Priority").toInt()) > (p2->property("X-KDE-Priority").toInt());
return (p1->property(QLatin1String( "X-KDE-Priority" )).toInt()) > (p2->property(QLatin1String( "X-KDE-Priority" )).toInt());
}
static QString determineMimeType(const QString& filename)
......@@ -66,7 +66,7 @@ static KService::List findPluginOffers(const QString& filename, const QString& f
const QString mimeType = fixedMimeType.isEmpty() ? determineMimeType(filename) : fixedMimeType;
if (!mimeType.isEmpty()) {
offers = KMimeTypeTrader::self()->query(mimeType, "Kerfuffle/Plugin", "(exist Library)");
offers = KMimeTypeTrader::self()->query(mimeType, QLatin1String( "Kerfuffle/Plugin" ), QLatin1String( "(exist Library)" ));
qSort(offers.begin(), offers.end(), comparePlugins);
}
......
......@@ -104,7 +104,7 @@ ExtractJob* ArchiveBase::copyFiles(const QList<QVariant> & files, const QString
{
ExtractionOptions newOptions = options;
if (isPasswordProtected())
newOptions["PasswordProtectedHint"] = true;
newOptions[QLatin1String( "PasswordProtectedHint" )] = true;
ExtractJob *newJob = new ExtractJob(files, destinationDir, newOptions, m_iface, this);
return newJob;
......@@ -140,7 +140,7 @@ void ArchiveBase::onListFinished(KJob* job)
QString base = fi.completeBaseName();
//special case for tar.gz/bzip2 files
if (base.right(4).toUpper() == ".TAR")
if (base.right(4).toUpper() == QLatin1String( ".TAR" ))
base.chop(4);
m_subfolderName = base;
......
......@@ -105,16 +105,16 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
QString argument = args.at(i);
kDebug() << "Processing argument " << argument;
if (argument == "$Archive") {
if (argument == QLatin1String( "$Archive" )) {
args[i] = filename();
}
if (argument == "$PreservePathSwitch") {
if (argument == QLatin1String( "$PreservePathSwitch" )) {
QStringList replacementFlags = m_param.value(PreservePathSwitch).toStringList();
Q_ASSERT(replacementFlags.size() == 2);
bool preservePaths = options.value("PreservePaths").toBool();
bool preservePaths = options.value(QLatin1String( "PreservePaths" )).toBool();
QString theReplacement;
if (preservePaths)
theReplacement = replacementFlags.at(0);
......@@ -130,7 +130,7 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
args[i] = theReplacement;
}
if (argument == "$PasswordSwitch") {
if (argument == QLatin1String( "$PasswordSwitch" )) {
//if the PasswordSwitch argument has been added, we at least
//assume that the format of the switch has been added as well
Q_ASSERT(m_param.contains(PasswordSwitch));
......@@ -140,7 +140,7 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
//if we get a hint about this being a password protected archive, ask about
//the password in advance.
if (options.value("PasswordProtectedHint").toBool() && password().isEmpty()) {
if (options.value(QLatin1String( "PasswordProtectedHint" )).toBool() && password().isEmpty()) {
kDebug() << "Password hint enabled, querying user";
Kerfuffle::PasswordNeededQuery query(filename());
......@@ -163,7 +163,7 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
QString newArg = theSwitch.at(j);
//substitute the $Path
newArg.replace("$Password", pass);
newArg.replace(QLatin1String( "$Password" ), pass);
//put it in the arg list
args.insert(i + j, newArg);
......@@ -174,7 +174,7 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
--i; //decrement to compensate for the variable we replaced
}
if (argument == "$RootNodeSwitch") {
if (argument == QLatin1String( "$RootNodeSwitch" )) {
//if the RootNodeSwitch argument has been added, we at least
//assume that the format of the switch has been added as well
Q_ASSERT(m_param.contains(RootNodeSwitch));
......@@ -183,8 +183,8 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
args.removeAt(i);
QString rootNode;
if (options.contains("RootNode")) {
rootNode = options.value("RootNode").toString();
if (options.contains(QLatin1String( "RootNode" ))) {
rootNode = options.value(QLatin1String( "RootNode" )).toString();
kDebug() << "Set root node " << rootNode;
}
......@@ -195,7 +195,7 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
QString newArg = theSwitch.at(j);
//substitute the $Path
newArg.replace("$Path", rootNode);
newArg.replace(QLatin1String( "$Path" ), rootNode);
//put it in the arg list
args.insert(i + j, newArg);
......@@ -206,7 +206,7 @@ bool CliInterface::copyFiles(const QList<QVariant> & files, const QString & dest
--i; //decrement to compensate for the variable we replaced
}
if (argument == "$Files") {
if (argument == QLatin1String( "$Files" )) {
args.removeAt(i);
for (int j = 0; j < files.count(); ++j) {
args.insert(i + j, escapeFileName(files.at(j).toString()));
......@@ -235,7 +235,7 @@ bool CliInterface::addFiles(const QStringList & files, const CompressionOptions&
return false;
}
const QString globalWorkDir = options.value("GlobalWorkDir").toString();
const QString globalWorkDir = options.value(QLatin1String( "GlobalWorkDir" )).toString();
const QDir workDir = globalWorkDir.isEmpty() ? QDir::current() : QDir(globalWorkDir);
if (!globalWorkDir.isEmpty()) {
kDebug() << "GlobalWorkDir is set, changing dir to " << globalWorkDir;
......@@ -250,11 +250,11 @@ bool CliInterface::addFiles(const QStringList & files, const CompressionOptions&
const QString argument = args.at(i);
kDebug() << "Processing argument " << argument;
if (argument == "$Archive") {
if (argument == QLatin1String( "$Archive" )) {
args[i] = filename();
}
if (argument == "$Files") {
if (argument == QLatin1String( "$Files" )) {
args.removeAt(i);
for (int j = 0; j < files.count(); ++j) {
// #191821: workDir must be used instead of QDir::current()
......@@ -294,11 +294,10 @@ bool CliInterface::deleteFiles(const QList<QVariant> & files)
QString argument = args.at(i);
kDebug() << "Processing argument " << argument;
if (argument == "$Archive") {
if (argument == QLatin1String( "$Archive" )) {
args[i] = filename();
}
if (argument == "$Files") {
else if (argument == QLatin1String( "$Files" )) {
args.removeAt(i);
for (int j = 0; j < files.count(); ++j) {
args.insert(i + j, escapeFileName(files.at(j).toString()));
......@@ -431,9 +430,9 @@ void CliInterface::readStdout(bool handleAll)
//freeze waiting for input. So we check for errors on the last line in
//all cases.
bool foundErrorMessage =
(checkForErrorMessage(lines.last(), WrongPasswordPatterns) ||
checkForErrorMessage(lines.last(), ExtractionFailedPatterns) ||
checkForFileExistsMessage(lines.last()));
(checkForErrorMessage(QLatin1String( lines.last() ), WrongPasswordPatterns) ||
checkForErrorMessage(QLatin1String( lines.last() ), ExtractionFailedPatterns) ||
checkForFileExistsMessage(QLatin1String( lines.last() )));
if (foundErrorMessage)
handleAll = true;
......@@ -466,7 +465,7 @@ void CliInterface::handleLine(const QString& line)
{
if ((m_operationMode == Copy || m_operationMode == Add) && m_param.contains(CaptureProgress) && m_param.value(CaptureProgress).toBool()) {
//read the percentage
int pos = line.indexOf('%');
int pos = line.indexOf(QLatin1Char( '%' ));
if (pos != -1 && pos > 1) {
int percentage = line.mid(pos - 2, 2).toInt();
progress(float(percentage) / 100);
......@@ -555,7 +554,7 @@ bool CliInterface::handleFileExistsMessage(const QString& line)
const QString filename = m_existsPattern.cap(1);
Kerfuffle::OverwriteQuery query(QDir::current().path() + '/' + filename);
Kerfuffle::OverwriteQuery query(QDir::current().path() + QLatin1Char( '/' ) + filename);
query.setNoRenameMode(true);
userQuery(&query);
kDebug() << "Waiting response";
......@@ -579,7 +578,7 @@ bool CliInterface::handleFileExistsMessage(const QString& line)
Q_ASSERT(!responseToProcess.isEmpty());
responseToProcess += '\n';
responseToProcess += QLatin1Char( '\n' );
kDebug() << "Writing " << responseToProcess;
......@@ -644,7 +643,7 @@ void CliInterface::substituteListVariables(QStringList& params)
for (int i = 0; i < params.size(); ++i) {
const QString parameter = params.at(i);
if (parameter == "$Archive") {
if (parameter == QLatin1String( "$Archive" )) {
params[i] = filename();
}
}
......
......@@ -58,7 +58,7 @@ ExtractionDialog::ExtractionDialog(QWidget *parent)
mainWidget()->layout()->addWidget(m_ui);
setCaption(i18nc("@title:window", "Extract"));
m_ui->iconLabel->setPixmap(DesktopIcon("archive-extract"));
m_ui->iconLabel->setPixmap(DesktopIcon(QLatin1String( "archive-extract" )));
m_ui->filesToExtractGroupBox->hide();
m_ui->allFilesButton->setChecked(true);
......@@ -96,7 +96,7 @@ void ExtractionDialog::batchModeOption()
void ExtractionDialog::accept()
{
if (extractToSubfolder()) {
if (subfolder().contains("/")) {
if (subfolder().contains(QLatin1String( "/" ))) {
KMessageBox::error(NULL, i18n("The subfolder name may not contain the character '/'."));
return;
}
......@@ -211,7 +211,7 @@ bool ExtractionDialog::closeAfterExtraction() const
KUrl ExtractionDialog::destinationDirectory() const
{
if (extractToSubfolder()) {
return url().pathOrUrl(KUrl::AddTrailingSlash) + subfolder() + '/';
return url().pathOrUrl(KUrl::AddTrailingSlash) + subfolder() + QLatin1Char( '/' );
} else {
return url().pathOrUrl(KUrl::AddTrailingSlash);
}
......
......@@ -184,7 +184,7 @@ void ListJob::onNewEntry(const ArchiveEntry& entry)
if (m_isSingleFolderArchive) {
const QString fileName(entry[FileName].toString());
const QString basePath(fileName.split('/').at(0));
const QString basePath(fileName.split(QLatin1Char( '/' )).at(0));
if (m_basePath.isEmpty()) {
m_basePath = basePath;
......@@ -239,8 +239,8 @@ void ExtractJob::doWork()
void ExtractJob::fillInDefaultValues(ExtractionOptions& options)
{
if (!options.contains("PreservePaths")) {
options["PreservePaths"] = false;
if (!options.contains(QLatin1String( "PreservePaths" ))) {
options[QLatin1String( "PreservePaths" )] = false;
}
}
......
......@@ -44,7 +44,7 @@ Query::Query()
QVariant Query::response()
{
return m_data.value("response");
return m_data.value(QLatin1String( "response" ));
}
void Query::waitForResponse()
......@@ -52,7 +52,7 @@ void Query::waitForResponse()
kDebug();
//if there is no response set yet, wait
if (!m_data.contains("response"))
if (!m_data.contains(QLatin1String( "response" )))
m_responseCondition.wait(&m_responseMutex);
m_responseMutex.unlock();
}
......@@ -61,15 +61,15 @@ void Query::setResponse(QVariant response)
{
kDebug();
m_data["response"] = response;
m_data[QLatin1String( "response" )] = response;
m_responseCondition.wakeAll();
}
OverwriteQuery::OverwriteQuery(QString filename) :
OverwriteQuery::OverwriteQuery(const QString &filename) :
m_noRenameMode(false),
m_multiMode(true)
{
m_data["filename"] = filename;
m_data[QLatin1String( "filename" )] = filename;
}
void OverwriteQuery::execute()
......@@ -86,8 +86,8 @@ void OverwriteQuery::execute()
mode = (KIO::RenameDialog_Mode)(mode | KIO::M_MULTI);
}
KUrl sourceUrl(m_data.value("filename").toString());
KUrl destUrl(m_data.value("filename").toString());
KUrl sourceUrl(m_data.value(QLatin1String( "filename" )).toString());
KUrl destUrl(m_data.value(QLatin1String( "filename" )).toString());
sourceUrl.cleanPath();
destUrl.cleanPath();
......@@ -99,7 +99,7 @@ void OverwriteQuery::execute()
mode);
dialog->exec();
m_data["newFilename"] = dialog->newDestUrl().pathOrUrl();
m_data[QLatin1String( "newFilename" )] = dialog->newDestUrl().pathOrUrl();
setResponse(dialog->result());
......@@ -110,35 +110,35 @@ void OverwriteQuery::execute()
bool OverwriteQuery::responseCancelled()
{
return m_data.value("response").toInt() == KIO::R_CANCEL;
return m_data.value(QLatin1String( "response" )).toInt() == KIO::R_CANCEL;
}
bool OverwriteQuery::responseOverwriteAll()
{
return m_data.value("response").toInt() == KIO::R_OVERWRITE_ALL;
return m_data.value(QLatin1String( "response" )).toInt() == KIO::R_OVERWRITE_ALL;
}
bool OverwriteQuery::responseOverwrite()
{
return m_data.value("response").toInt() == KIO::R_OVERWRITE;
return m_data.value(QLatin1String( "response" )).toInt() == KIO::R_OVERWRITE;
}
bool OverwriteQuery::responseRename()
{
return m_data.value("response").toInt() == KIO::R_RENAME;
return m_data.value(QLatin1String( "response" )).toInt() == KIO::R_RENAME;
}
bool OverwriteQuery::responseSkip()
{
return m_data.value("response").toInt() == KIO::R_SKIP;
return m_data.value(QLatin1String( "response" )).toInt() == KIO::R_SKIP;
}
bool OverwriteQuery::responseAutoSkip()
{
return m_data.value("response").toInt() == KIO::R_AUTO_SKIP;
return m_data.value(QLatin1String( "response" )).toInt() == KIO::R_AUTO_SKIP;
}
QString OverwriteQuery::newFilename()
{
return m_data.value("newFilename").toString();
return m_data.value(QLatin1String( "newFilename" )).toString();
}
void OverwriteQuery::setNoRenameMode(bool enableNoRenameMode)
......@@ -161,10 +161,10 @@ bool OverwriteQuery::multiMode()
return m_multiMode;
}
PasswordNeededQuery::PasswordNeededQuery(QString archiveFilename, bool incorrectTryAgain)
PasswordNeededQuery::PasswordNeededQuery(const QString& archiveFilename, bool incorrectTryAgain)
{
m_data["archiveFilename"] = archiveFilename;
m_data["incorrectTryAgain"] = incorrectTryAgain;
m_data[QLatin1String( "archiveFilename" )] = archiveFilename;
m_data[QLatin1String( "incorrectTryAgain" )] = incorrectTryAgain;
}
void PasswordNeededQuery::execute()
......@@ -174,16 +174,16 @@ void PasswordNeededQuery::execute()
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
QPointer<KPasswordDialog> dlg = new KPasswordDialog(NULL);
dlg->setPrompt(i18n("The archive '%1' is password protected. Please enter the password to extract the file.", m_data.value("archiveFilename").toString()));
dlg->setPrompt(i18n("The archive '%1' is password protected. Please enter the password to extract the file.", m_data.value(QLatin1String( "archiveFilename" )).toString()));
if (m_data.value("incorrectTryAgain").toBool()) {
if (m_data.value(QLatin1String( "incorrectTryAgain" )).toBool()) {
dlg->showErrorMessage(i18n("Incorrect password, please try again."), KPasswordDialog::PasswordError);
}
if (!dlg->exec()) {
setResponse(false);
} else {
m_data["password"] = dlg->password();
m_data[QLatin1String( "password" )] = dlg->password();
setResponse(true);
}
......@@ -194,11 +194,11 @@ void PasswordNeededQuery::execute()
QString PasswordNeededQuery::password()
{
return m_data.value("password").toString();
return m_data.value(QLatin1String( "password" )).toString();
}
bool PasswordNeededQuery::responseCancelled()
{
return !m_data.value("response").toBool();
return !m_data.value(QLatin1String( "response" )).toBool();
}
}
......@@ -77,7 +77,7 @@ private:
class KERFUFFLE_EXPORT OverwriteQuery : public Query
{
public:
explicit OverwriteQuery(QString filename);
explicit OverwriteQuery(const QString& filename);
void execute();
bool responseCancelled();
bool responseOverwriteAll();
......@@ -99,7 +99,7 @@ private:
class KERFUFFLE_EXPORT PasswordNeededQuery : public Query
{
public:
explicit PasswordNeededQuery(QString archiveFilename, bool incorrectTryAgain = false);
explicit PasswordNeededQuery(const QString& archiveFilename, bool incorrectTryAgain = false);
void execute();
bool responseCancelled();
......
......@@ -92,7 +92,7 @@ public:
void setEntry(const ArchiveEntry& entry) {
m_entry = entry;
const QStringList pieces = entry[FileName].toString().split('/', QString::SkipEmptyParts);
const QStringList pieces = entry[FileName].toString().split(QLatin1Char( '/' ), QString::SkipEmptyParts);
m_name = pieces.isEmpty() ? QString() : pieces.last();
}
......@@ -129,7 +129,7 @@ class ArchiveDirNode: public ArchiveNode
public:
ArchiveDirNode(ArchiveDirNode *parent, const ArchiveEntry & entry)
: ArchiveNode(parent, entry) {
m_icon = KIconLoader::global()->loadMimeTypeIcon(KMimeType::mimeType("inode/directory")->iconName(), KIconLoader::Small);
m_icon = KIconLoader::global()->loadMimeTypeIcon(KMimeType::mimeType(QLatin1String( "inode/directory" ))->iconName(), KIconLoader::Small);
}
......@@ -250,7 +250,7 @@ QVariant ArchiveModel::data(const QModelIndex &index, int role) const
return QVariant();
} else {
int ratio = int(100 * ((double)size - compressedSize) / size);
return QString::number(ratio) + " %";
return QString::number(ratio) + QLatin1String( " %" );
}
}
......@@ -462,11 +462,11 @@ QStringList ArchiveModel::mimeTypes() const
{
QStringList types;
types << QString("text/uri-list")
<< QString("text/plai