generic: prepare for KuitSemantics changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-03 08:53:32 +03:00
parent e918508d04
commit 6260843dde
9 changed files with 32 additions and 32 deletions

View file

@ -110,7 +110,7 @@ void ExtractionDialog::accept()
while (1) {
if (KIO::NetAccess::exists(pathWithSubfolder, KIO::NetAccess::SourceSide, 0)) {
if (QFileInfo(pathWithSubfolder).isDir()) {
int overwrite = KMessageBox::questionYesNoCancel(0, i18nc("@info", "The folder <filename>%1</filename> already exists. Are you sure you want to extract here?", pathWithSubfolder), i18n("Folder exists"), KGuiItem(i18n("Extract here")), KGuiItem(i18n("Retry")), KGuiItem(i18n("Cancel")));
int overwrite = KMessageBox::questionYesNoCancel(0, i18nc("@info", "The folder <tt>%1</tt> already exists. Are you sure you want to extract here?", pathWithSubfolder), i18n("Folder exists"), KGuiItem(i18n("Extract here")), KGuiItem(i18n("Retry")), KGuiItem(i18n("Cancel")));
if (overwrite == KMessageBox::No) {
// The user clicked Retry.
@ -120,13 +120,13 @@ void ExtractionDialog::accept()
}
} else {
KMessageBox::detailedError(0,
i18nc("@info", "The folder <filename>%1</filename> could not be created.", subfolder()),
i18nc("@info", "<filename>%1</filename> already exists, but is not a folder.", subfolder()));
i18nc("@info", "The folder <tt>%1</tt> could not be created.", subfolder()),
i18nc("@info", "<tt>%1</tt> already exists, but is not a folder.", subfolder()));
return;
}
} else if (!KIO::NetAccess::mkdir(pathWithSubfolder, 0)) {
KMessageBox::detailedError(0,
i18nc("@info", "The folder <filename>%1</filename> could not be created.", subfolder()),
i18nc("@info", "The folder <tt>%1</tt> could not be created.", subfolder()),
i18n("Please check your permissions to create it."));
return;
}

View file

@ -175,7 +175,7 @@ void PasswordNeededQuery::execute()
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
QWeakPointer<KPasswordDialog> dlg = new KPasswordDialog;
dlg.data()->setPrompt(i18nc("@info", "The archive <filename>%1</filename> is password protected. Please enter the password to extract the file.", m_data.value(QLatin1String( "archiveFilename" )).toString()));
dlg.data()->setPrompt(i18nc("@info", "The archive <tt>%1</tt> is password protected. Please enter the password to extract the file.", m_data.value(QLatin1String( "archiveFilename" )).toString()));
if (m_data.value(QLatin1String("incorrectTryAgain")).toBool()) {
dlg.data()->showErrorMessage(i18n("Incorrect password, please try again."), KPasswordDialog::PasswordError);

View file

@ -396,14 +396,14 @@ bool Part::openFile()
if (localFileInfo.isDir()) {
KMessageBox::error(NULL, i18nc("@info",
"<filename>%1</filename> is a directory.",
"<tt>%1</tt> is a directory.",
localFile));
return false;
}
if (creatingNewArchive) {
if (localFileInfo.exists()) {
int overwrite = KMessageBox::questionYesNo(NULL, i18nc("@info", "The archive <filename>%1</filename> already exists. Would you like to open it instead?", localFile), i18nc("@title:window", "File Exists"), KGuiItem(i18n("Open File")), KStandardGuiItem::cancel());
int overwrite = KMessageBox::questionYesNo(NULL, i18nc("@info", "The archive <tt>%1</tt> already exists. Would you like to open it instead?", localFile), i18nc("@title:window", "File Exists"), KGuiItem(i18n("Open File")), KStandardGuiItem::cancel());
if (overwrite == KMessageBox::No) {
return false;
@ -411,7 +411,7 @@ bool Part::openFile()
}
} else {
if (!localFileInfo.exists()) {
KMessageBox::sorry(NULL, i18nc("@info", "The archive <filename>%1</filename> was not found.", localFile), i18nc("@title:window", "Error Opening Archive"));
KMessageBox::sorry(NULL, i18nc("@info", "The archive <tt>%1</tt> was not found.", localFile), i18nc("@title:window", "Error Opening Archive"));
return false;
}
}
@ -464,7 +464,7 @@ bool Part::openFile()
}
if (!archive) {
KMessageBox::sorry(NULL, i18nc("@info", "Ark was not able to open the archive <filename>%1</filename>. No plugin capable of handling the file was found.", localFile), i18nc("@title:window", "Error Opening Archive"));
KMessageBox::sorry(NULL, i18nc("@info", "Ark was not able to open the archive <tt>%1</tt>. No plugin capable of handling the file was found.", localFile), i18nc("@title:window", "Error Opening Archive"));
return false;
}
@ -500,7 +500,7 @@ void Part::slotLoadingFinished(KJob *job)
if (job->error()) {
if (arguments().metaData()[QLatin1String( "createNewArchive" )] != QLatin1String( "true" )) {
KMessageBox::sorry(NULL, i18nc("@info", "Loading the archive <filename>%1</filename> failed with the following error: <i>%2</i>", localFilePath(), job->errorText()), i18nc("@title:window", "Error Opening Archive"));
KMessageBox::sorry(NULL, i18nc("@info", "Loading the archive <tt>%1</tt> failed with the following error: <i>%2</i>", localFilePath(), job->errorText()), i18nc("@title:window", "Error Opening Archive"));
// The file failed to open, so reset the open archive, info panel and caption.
m_model->setArchive(NULL);
@ -915,7 +915,7 @@ void Part::slotSaveAs()
if ((saveUrl.isValid()) && (!saveUrl.isEmpty())) {
if (KIO::NetAccess::exists(saveUrl, KIO::NetAccess::DestinationSide, widget())) {
int overwrite = KMessageBox::warningContinueCancel(widget(),
i18nc("@info", "An archive named <filename>%1</filename> already exists. Are you sure you want to overwrite it?", saveUrl.fileName()),
i18nc("@info", "An archive named <tt>%1</tt> already exists. Are you sure you want to overwrite it?", saveUrl.fileName()),
QString(),
KStandardGuiItem::overwrite());
@ -929,7 +929,7 @@ void Part::slotSaveAs()
if (!QFile::exists(localFilePath())) {
if (url().isLocalFile()) {
KMessageBox::error(widget(),
i18nc("@info", "The archive <filename>%1</filename> cannot be copied to the specified location. The archive does not exist anymore.", localFilePath()));
i18nc("@info", "The archive <tt>%1</tt> cannot be copied to the specified location. The archive does not exist anymore.", localFilePath()));
return;
} else {
@ -941,7 +941,7 @@ void Part::slotSaveAs()
if (!KIO::NetAccess::synchronousRun(copyJob, widget())) {
KMessageBox::error(widget(),
i18nc("@info", "The archive could not be saved as <filename>%1</filename>. Try saving it to another location.", saveUrl.pathOrUrl()));
i18nc("@info", "The archive could not be saved as <tt>%1</tt>. Try saving it to another location.", saveUrl.pathOrUrl()));
}
}
}

View file

@ -64,7 +64,7 @@ bool LibArchiveInterface::list()
{
KArchive karchive(filename());
if (!karchive.isReadable()) {
emit error(i18nc("@info", "Could not open the archive <filename>%1</filename>: %2.", filename(), karchive.errorString()));
emit error(i18nc("@info", "Could not open the archive <tt>%1</tt>: %2.", filename(), karchive.errorString()));
return false;
}
@ -86,7 +86,7 @@ bool LibArchiveInterface::copyFiles(const QVariantList& files, const QString &de
KArchive karchive(filename());
if (!karchive.isReadable()) {
emit error(i18nc("@info", "Could not open the archive <filename>%1</filename>: %2.", filename(), karchive.errorString()));
emit error(i18nc("@info", "Could not open the archive <tt>%1</tt>: %2.", filename(), karchive.errorString()));
return false;
}
@ -173,7 +173,7 @@ bool LibArchiveInterface::addFiles(const QStringList &files, const CompressionOp
KArchive karchive(filename());
if (!karchive.isWritable()) {
emit error(i18nc("@info", "Could not open the archive <filename>%1</filename>: %2.", filename(), karchive.errorString()));
emit error(i18nc("@info", "Could not open the archive <tt>%1</tt>: %2.", filename(), karchive.errorString()));
return false;
}
@ -211,7 +211,7 @@ bool LibArchiveInterface::deleteFiles(const QVariantList &files)
{
KArchive karchive(filename());
if (!karchive.isWritable()) {
emit error(i18nc("@info", "Could not open the archive <filename>%1</filename>: %2.", filename(), karchive.errorString()));
emit error(i18nc("@info", "Could not open the archive <tt>%1</tt>: %2.", filename(), karchive.errorString()));
return false;
}

View file

@ -69,7 +69,7 @@ bool LibSingleFileInterface::copyFiles(const QList<QVariant> &files, const QStri
if (!kdecompressor.setType(KDecompressor::typeForMime(m_mimeType))
&& !kdecompressor.setType(KDecompressor::typeForFile(inputfile))) {
kDebug() << "Could not set KDecompressor type";
emit error(i18nc("@info", "Ark could not open <filename>%1</filename> for extraction.", inputfile));
emit error(i18nc("@info", "Ark could not open <tt>%1</tt> for extraction.", inputfile));
return false;
}
@ -77,20 +77,20 @@ bool LibSingleFileInterface::copyFiles(const QList<QVariant> &files, const QStri
QFile inputdevice(inputfile);
if (!inputdevice.open(QFile::ReadOnly)) {
kDebug() << "Could not open input file";
emit error(i18n("Ark could not open <filename>%1</filename> for reading.", inputfile));
emit error(i18n("Ark could not open <tt>%1</tt> for reading.", inputfile));
return false;
}
if (!kdecompressor.process(inputdevice.readAll())) {
kDebug() << "Could not process input";
emit error(i18n("Ark could not process <filename>%1</filename>.", inputfile));
emit error(i18n("Ark could not process <tt>%1</tt>.", inputfile));
return false;
}
QFile outputdevice(outputFileName);
if (!outputdevice.open(QIODevice::WriteOnly)) {
kDebug() << "Failed to open output file" << outputdevice.errorString();
emit error(i18nc("@info", "Ark could not open <filename>%1</filename> for writing.", outputFileName));
emit error(i18nc("@info", "Ark could not open <tt>%1</tt> for writing.", outputFileName));
return false;
}
@ -98,7 +98,7 @@ bool LibSingleFileInterface::copyFiles(const QList<QVariant> &files, const QStri
const QByteArray decompressed = kdecompressor.result();
if (outputdevice.write(decompressed.constData(), decompressed.size()) != decompressed.size()) {
kDebug() << "Could not write output file";
emit error(i18n("Ark could not write <filename>%1</filename>.", outputFileName));
emit error(i18n("Ark could not write <tt>%1</tt>.", outputFileName));
QFile::remove(outputFileName); // in case of partial write
return false;
}
@ -186,27 +186,27 @@ bool LibSingleFileInterface::addFiles(const QStringList & files, const Kerfuffle
QFile inputdevice(inputfile);
if (!inputdevice.open(QFile::ReadOnly)) {
kDebug() << "Could not open input file";
emit error(i18n("Ark could not open <filename>%1</filename> for reading.", inputfile));
emit error(i18n("Ark could not open <tt>%1</tt> for reading.", inputfile));
return false;
}
if (!kcompressor.process(inputdevice.readAll())) {
kDebug() << "Could not process input";
emit error(i18n("Ark could not process <filename>%1</filename>.", inputfile));
emit error(i18n("Ark could not process <tt>%1</tt>.", inputfile));
return false;
}
QFile outputdevice(outputfile);
if (!outputdevice.open(QFile::WriteOnly)) {
kDebug() << "Could not open output file";
emit error(i18n("Ark could not open <filename>%1</filename> for writing.", outputfile));
emit error(i18n("Ark could not open <tt>%1</tt> for writing.", outputfile));
return false;
}
const QByteArray compressed = kcompressor.result();
if (outputdevice.write(compressed.constData(), compressed.size()) != compressed.size()) {
kDebug() << "Could not write output file";
emit error(i18n("Ark could not write <filename>%1</filename>.", outputfile));
emit error(i18n("Ark could not write <tt>%1</tt>.", outputfile));
QFile::remove(outputfile); // in case of partial write
return false;
}

View file

@ -190,7 +190,7 @@ void rename(const KUrl& oldUrl, QWidget* parent)
{
QString name = KInputDialog::getText(
i18nc("@title:window", "Rename") /* caption */,
i18n("Rename <filename>%1</filename> to:", oldUrl.fileName()) /* label */,
i18n("Rename <tt>%1</tt> to:", oldUrl.fileName()) /* label */,
oldUrl.fileName() /* value */,
0 /* ok */,
parent

View file

@ -238,7 +238,7 @@ void GvCore::saveAs(const KUrl& url)
int answer = KMessageBox::warningContinueCancel(
d->mMainWindow,
i18nc("@info",
"A file named <filename>%1</filename> already exists.\n"
"A file named <tt>%1</tt> already exists.\n"
"Are you sure you want to overwrite it?",
saveAsUrl.fileName()),
QString(),
@ -253,7 +253,7 @@ void GvCore::saveAs(const KUrl& url)
KJob* job = doc->save(saveAsUrl, format.data());
if (!job) {
const QString name = saveAsUrl.fileName().isEmpty() ? saveAsUrl.pathOrUrl() : saveAsUrl.fileName();
const QString msg = i18nc("@info", "<b>Saving <filename>%1</filename> failed:</b><br>%2",
const QString msg = i18nc("@info", "<b>Saving <tt>%1</tt> failed:</b><br>%2",
name, doc->errorString());
KMessageBox::sorry(QApplication::activeWindow(), msg);
} else {
@ -276,7 +276,7 @@ void GvCore::slotSaveResult(KJob* _job)
if (job->error()) {
QString name = newUrl.fileName().isEmpty() ? newUrl.pathOrUrl() : newUrl.fileName();
QString msg = i18nc("@info", "<b>Saving <filename>%1</filename> failed:</b><br>%2",
QString msg = i18nc("@info", "<b>Saving <tt>%1</tt> failed:</b><br>%2",
name, job->errorString());
int result = KMessageBox::warningContinueCancel(

View file

@ -103,7 +103,7 @@ void SaveAllHelper::slotResult(KJob* _job)
KUrl url = job->document()->url();
QString name = url.fileName().isEmpty() ? url.pathOrUrl() : url.fileName();
d->mErrorList << i18nc("@info %1 is the name of the document which failed to save, %2 is the reason for the failure",
"<filename>%1</filename>: %2", name, job->errorString());
"<tt>%1</tt>: %2", name, job->errorString());
}
d->mJobSet.remove(job);
QProgressBar* bar = d->mProgressDialog->progressBar();

View file

@ -445,7 +445,7 @@ void DocumentView::slotLoadingFailed()
d->hideLoadingIndicator();
MessageViewAdapter* adapter = new MessageViewAdapter();
adapter->setDocument(d->mDocument);
QString message = i18n("Loading <filename>%1</filename> failed", d->mDocument->url().fileName());
QString message = i18n("Loading <tt>%1</tt> failed", d->mDocument->url().fileName());
adapter->setErrorMessage(message, d->mDocument->errorString());
d->setCurrentAdapter(adapter);
d->updateCaption();