Commit eb678845 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent 68a0c6e9
Pipeline #136440 passed with stage
in 1 minute and 47 seconds
......@@ -63,7 +63,7 @@ void RenameDialog::setFilename(const QString &filename)
const QMimeDatabase db;
const QString extension = db.suffixForFileName(filename);
int selectionLength = filename.length();
if (extension.length() > 0) {
if (!extension.isEmpty()) {
// The filename contains an extension. Assure that only the filename
// gets selected.
selectionLength -= extension.length() + 1;
......
......@@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
struct GVBrowserExtensionPrivate {
KParts::ReadOnlyPart *mPart;
KParts::ReadOnlyPart *mPart = nullptr;
};
GVBrowserExtension::GVBrowserExtension(KParts::ReadOnlyPart *part)
......
......@@ -142,8 +142,8 @@ void GVPart::saveAs()
KIO::Job *job;
Document::Ptr doc = DocumentFactory::instance()->load(srcUrl);
QByteArray rawData = doc->rawData();
if (rawData.length() > 0) {
const QByteArray rawData = doc->rawData();
if (!rawData.isEmpty()) {
job = KIO::storedPut(rawData, dstUrl, -1);
} else {
job = KIO::file_copy(srcUrl, dstUrl);
......
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