Commit 2f54e775 authored by Toni Asensi Esteve's avatar Toni Asensi Esteve
Browse files

Archives: Add comments in order to avoid problems with code that is related to archives

Add some comments to the source code in order to avoid problems in the future.

Test plan: The one described in the task [Solve some bugs related to archives, remove some duplicated code](https://phabricator.kde.org/T12876).

Differential Revision: https://phabricator.kde.org/D28412
parent b4e01680
......@@ -1722,6 +1722,9 @@ bool kio_krarcProtocol::checkStatus(int exitCode)
void kio_krarcProtocol::checkIf7zIsEncrypted(bool &encrypted, QString fileName)
{
// Reminder: If that function is modified, it's important to research if the
// changes must also be applied to `KRarcHandler::checkIf7zIsEncrypted()`
KRFUNC;
if (encryptedArchPath == fileName)
encrypted = true;
......@@ -1753,6 +1756,9 @@ void kio_krarcProtocol::checkIf7zIsEncrypted(bool &encrypted, QString fileName)
void kio_krarcProtocol::check7zOutputForPassword(KProcess * proc, QByteArray & buf)
{
// Reminder: If that function is modified, it's important to research if the
// changes must also be applied to `Kr7zEncryptionChecker::receivedOutput()`
KRFUNC;
QString data = QString(buf);
......@@ -1869,6 +1875,10 @@ QString kio_krarcProtocol::detectFullPathName(QString name)
QString kio_krarcProtocol::fullPathName(const QString& name)
{
// Reminder: If that function is modified, it's important to research if the
// changes must also be applied to `KrServices::fullPathName()`
// and `KrServices::cmdExist()`
// Note: KRFUNC was not used here in order to avoid filling the log with too much information
KRDEBUG(name);
......
......@@ -36,6 +36,9 @@ void Kr7zEncryptionChecker::setupChildProcess()
void Kr7zEncryptionChecker::receivedOutput()
{
// Reminder: If that function is modified, it's important to research if the
// changes must also be applied to `kio_krarcProtocol::check7zOutputForPassword()`
QString data = QString::fromLocal8Bit(this->readAllStandardOutput());
QString checkable = lastData + data;
......
......@@ -658,6 +658,9 @@ bool KRarcHandler::checkStatus(const QString& type, int exitCode)
void KRarcHandler::checkIf7zIsEncrypted(bool &encrypted, QString fileName)
{
// Reminder: If that function is modified, it's important to research if the
// changes must also be applied to `kio_krarcProtocol::checkIf7zIsEncrypted()`
Kr7zEncryptionChecker proc;
// TODO incorporate all this in Kr7zEncryptionChecker
proc << KrServices::fullPathName("7z") << "-y" << "t";
......
......@@ -89,6 +89,10 @@ QSet<QString> KrServices::generateKrarcArchiveMimetypes()
bool KrServices::cmdExist(const QString& cmdName)
{
// Reminder: If that function is modified, it's important to research if the
// changes must also be applied to `KrServices::fullPathName()`
// and `kio_krarcProtocol::fullPathName()`
KConfigGroup group(krConfig, "Dependencies");
if (QFile(group.readEntry(cmdName, QString())).exists())
return true;
......@@ -98,6 +102,10 @@ bool KrServices::cmdExist(const QString& cmdName)
QString KrServices::fullPathName(const QString& name, QString confName)
{
// Reminder: If that function is modified, it's important to research if the
// changes must also be applied to `kio_krarcProtocol::fullPathName()`
// and `KrServices::cmdExist()`
QString supposedName;
if (confName.isNull())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment