r24649 by craig - Some workarounds for building with Qt6
scribus-commit
scribus-commit at lists.scribus.net
Thu May 27 21:22:44 UTC 2021
Author: craig
Date: Thu May 27 21:22:44 2021
New Revision: 24649
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24649
Log:
Some workarounds for building with Qt6
Modified:
trunk/Scribus/scribus/CMakeLists.txt
trunk/Scribus/scribus/third_party/zip/zip.cpp
trunk/Scribus/scribus/util.h
Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24649&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Thu May 27 21:22:44 2021
@@ -5,7 +5,11 @@
# a custom target that is always built
if (NOT CMAKE_VERSION VERSION_LESS "3.2.0")
- add_custom_target(svnheader ALL COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_MODULE_PATH}/getsvn.cmake BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h)
+ if (WANT_QT6)
+ add_custom_target(svnheader ALL COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/modules/getsvn.cmake BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h)
+ else()
+ add_custom_target(svnheader ALL COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_MODULE_PATH}/getsvn.cmake BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h)
+ endif()
else ()
add_custom_target(svnheader ALL DEPENDS svn_header ) # svn_header is nothing more than a unique string
# creates svnheader.h using cmake script
Modified: trunk/Scribus/scribus/third_party/zip/zip.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24649&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 Thu May 27 21:22:44 2021
@@ -543,7 +543,7 @@
while (b != e) {
const ZippedDir& zd = b.value();
if (zd.files <= 0) {
- ec = createEntry(b.key(), zd.actualRoot, level);
+ ec = createEntry(QFileInfo(b.key()), zd.actualRoot, level);
}
++b;
}
Modified: trunk/Scribus/scribus/util.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24649&path=/trunk/Scribus/scribus/util.h
==============================================================================
--- trunk/Scribus/scribus/util.h (original)
+++ trunk/Scribus/scribus/util.h Thu May 27 21:22:44 2021
@@ -18,6 +18,7 @@
#include <QPainterPath>
#include <QPair>
#include <QPixmap>
+#include <QRegularExpression>
#include <QStack>
#include <QString>
#include <QStringList>
@@ -176,10 +177,11 @@
// capture the name and the index, if any
// fred (5)
// ^^^^ ^ (where ^ means captured)
- static QRegExp rx("^(.*)\\s+\\((\\d+)\\)$");
- if (rx.indexIn(newName) != -1)
+ static QRegularExpression rx("^(.*)\\s+\\((\\d+)\\)$");
+ QRegularExpressionMatch match = rx.match(newName);
+ if (match.hasMatch())
{
- QStringList matches = rx.capturedTexts();
+ QStringList matches = rx.namedCaptureGroups();
prefix = matches[1];
suffixNum = matches[2].toInt();
}
More information about the scribus-commit
mailing list