r25029 by jghali - Fix deprecation warning related to use of QScopedPointer::take()

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 13 01:25:24 UTC 2022


Author: jghali
Date: Sun Mar 13 01:25:23 2022
New Revision: 25029

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25029
Log:
Fix deprecation warning related to use of QScopedPointer::take()

Modified:
    trunk/Scribus/scribus/third_party/zip/zip.cpp

Modified: trunk/Scribus/scribus/third_party/zip/zip.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25029&path=/trunk/Scribus/scribus/third_party/zip/zip.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/zip/zip.cpp	(original)
+++ trunk/Scribus/scribus/third_party/zip/zip.cpp	Sun Mar 13 01:25:23 2022
@@ -32,6 +32,7 @@
 // we only use this to seed the random number generator
 #include <algorithm>
 #include <ctime>
+#include <memory>
 
 #include <QtCore/QCoreApplication>
 #include <QtCore/QDateTime>
@@ -755,7 +756,7 @@
 
 
 	// create header and store it to write a central directory later
-    QScopedPointer<ZipEntryP> h(new ZipEntryP);
+    auto h = std::make_unique<ZipEntryP>();
     h->absolutePath = file.absoluteFilePath().toLower();
     h->fileSize = file.size();
 
@@ -895,7 +896,7 @@
         const Zip::ErrorCode ec = deflateFile(file, crc, written, level, encrypt ? &k : 0);
         if (ec != Zip::Ok)
             return ec;
-        Q_ASSERT(!h.isNull());
+        Q_ASSERT(h.get() != nullptr);
 	}
 
 	// Store end of entry offset
@@ -943,7 +944,7 @@
 		}
 	}
 
-    headers->insert(entryName, h.take());
+    headers->insert(entryName, h.release());
 	return Zip::Ok;
 }
 




More information about the scribus-commit mailing list