D27181: Rename dialog displays also source file information

Ragnar Thomsen noreply at phabricator.kde.org
Sun May 3 22:43:42 BST 2020


rthomsen requested changes to this revision.
rthomsen added a comment.
This revision now requires changes to proceed.


  Almost ready :)

INLINE COMMENTS

> cliinterface.cpp:598-600
> +                                            relEntry.fileTime(QFileDevice::FileModificationTime),
> +                                            relEntry.fileTime(QFileDevice::FileModificationTime),
> +                                            relEntry.size()

`dirIt.filePath()` points to the source file so create a `QFileInfo` and use that to get the properties. Also please use `QFileInfo::birthTime()` and `QFileInfo::lastModified()` here to get ctime and mtime, respectively.

> cliinterface.cpp:979
>      }
> -
> -    Kerfuffle::OverwriteQuery query(QDir::current().path() + QLatin1Char( '/' ) + m_storedFileName);
> +    QFileInfo fileInfo = QFileInfo(m_storedFileName);
> +    Kerfuffle::OverwriteQuery query(QDir::current().path() + QLatin1Char( '/' ) + m_storedFileName,

In this case we can't easily get the properties of the source file, so I guess we should do the same as previously and just send the destination file properties. You should use `QDir::current().path() + QLatin1Char( '/' ) + m_storedFileName` then.

Also please use `QFileInfo::birthTime()` and `QFileInfo::lastModified()`.

> queries.h:85
>  public:
> -    explicit OverwriteQuery(const QString& filename);
> +    explicit OverwriteQuery(const QString& filename, QDateTime date_src, QDateTime mdate_src, qulonglong size_src );
>      void execute() override;

We mostly use camelcase-style in Ark so please call these arguments: `ctimeSrc`, `mtimeSrc` and `sizeSrc` (and the member variables the same just prefixed with `m_`.

> singlefileplugin.cpp:123-124
> +        Kerfuffle::OverwriteQuery query(newFileInfo.absoluteFilePath(),
> +                                        newFileInfo.fileTime(QFileDevice::FileModificationTime),
> +                                        newFileInfo.fileTime(QFileDevice::FileModificationTime),
> +                                        newFileInfo.size()

Please use `QFileInfo::birthTime()` and `QFileInfo::lastModified()`.

> libzipplugin.cpp:651
> +                Kerfuffle::OverwriteQuery query(renamedEntry,
> +                                    QDateTime::fromSecsSinceEpoch(statBuffer.mtime),
> +                                    QDateTime::fromSecsSinceEpoch(statBuffer.mtime),

Zip format doesn't store ctime, so guess it makes sense to pass mtime for both.

REVISION DETAIL
  https://phabricator.kde.org/D27181

To: papoteur, #ark, elvisangelaccio, rthomsen
Cc: rthomsen, meven, kde-utils-devel, fbampaloukas, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20200503/643a7673/attachment-0001.html>


More information about the Kde-utils-devel mailing list