Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)

project(MoleQueue)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# Request C++11 standard, using new CMake variables.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS False)
# Set symbol visibility defaults for all targets.
Expand Down
18 changes: 9 additions & 9 deletions molequeue/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
set(_qt_packages Core Widgets Network)
set(_qt_packages Core Core5Compat Widgets Network)
if(ENABLE_TESTING)
list(APPEND _qt_packages Test)
endif()
if(MoleQueue_USE_EZHPC_UIT)
list(APPEND _qt_packages XmlPatterns)
endif()
find_package(Qt5 REQUIRED COMPONENTS ${_qt_packages})
find_package(Qt6 REQUIRED COMPONENTS ${_qt_packages})
Comment on lines 5 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🌐 Web query:

Is QtXmlPatterns module available in Qt 6 or has it been removed?

💡 Result:

The QtXmlPatterns module has been removed in Qt 6.[1][2] Official Qt 6 documentation lists Qt XML (for DOM) as available,[3][4] but QtXmlPatterns (for XPath/XQuery/XSLT) is absent from all Qt 6 module lists and explicitly stated as removed in Qt 6.0.[1] It was deprecated in Qt 5.13[5] and is only documented for Qt 5.[6][5] Qt forums and mailing lists confirm its removal with no direct replacement in Qt 6.[7][2]

Citations:


🏁 Script executed:

find . -name "CMakeLists.txt" -path "*/molequeue/app/*" -type f

Repository: OpenChemistry/molequeue

Length of output: 190


🏁 Script executed:

cat -n ./molequeue/app/CMakeLists.txt | head -20

Repository: OpenChemistry/molequeue

Length of output: 775


🏁 Script executed:

cat -n ./molequeue/app/CMakeLists.txt | tail -100

Repository: OpenChemistry/molequeue

Length of output: 3871


🏁 Script executed:

rg -l "wsdl_uitapi\.cpp" .

Repository: OpenChemistry/molequeue

Length of output: 98


Qt6 does not ship XmlPatterns — this find_package call will fail when MoleQueue_USE_EZHPC_UIT=ON.

QtXmlPatterns was removed from Qt 6 with no upstream Qt6 port; only Qt5 had the module. Line 6 unconditionally appends XmlPatterns to the find_package(Qt6 ...) COMPONENTS list when the feature is enabled, and line 178 attempts to link Qt6::XmlPatterns, which does not exist as a target.

When MoleQueue_USE_EZHPC_UIT=ON, any build will fail immediately at the find_package step, and wsdl_uitapi.cpp cannot compile.

Options:

  • Keep this branch on Qt5 explicitly (e.g., find_package(Qt5 REQUIRED COMPONENTS XmlPatterns) and link Qt5::XmlPatterns only inside the UIT block). This is awkward but likely simplest as a stopgap.
  • Pull from a community/3rd-party Qt6 port of XmlPatterns (e.g., via a vendored copy) — non-trivial.
  • Replace QtXmlPatterns usage in wsdl_uitapi.cpp / KDSoap with a still-supported XML stack (QtXml + a third-party XPath/XSLT), or disable the UIT integration on Qt6.

At minimum, the EZHPC UIT path should be marked unsupported under Qt6 and gated so the default build doesn't fail.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@molequeue/app/CMakeLists.txt` around lines 5 - 8, The build appends
XmlPatterns into the Qt6 find_package unconditionally which fails because Qt6
has no XmlPatterns; update the CMake logic so when MoleQueue_USE_EZHPC_UIT is
enabled you either (a) use Qt5 for that branch by calling find_package(Qt5
REQUIRED COMPONENTS XmlPatterns) and link Qt5::XmlPatterns only inside the UIT
block (e.g., guard the XmlPatterns add and linking of Qt6::XmlPatterns), or (b)
explicitly disable/gate the EZHPC UIT path under Qt6 by skipping the XmlPatterns
append and the linking of Qt6::XmlPatterns and emitting a clear message, and
ensure wsdl_uitapi.cpp / KDSoap linking only occurs when the proper XmlPatterns
target exists; adjust the conditional around the XmlPatterns append and the
target link to reference MoleQueue_USE_EZHPC_UIT and Qt major version checks so
builds on Qt6 do not call find_package(Qt6 COMPONENTS XmlPatterns) or link
Qt6::XmlPatterns.


# Provide some simple API to find the plugins, scripts, etc.
if(APPLE)
Expand All @@ -15,7 +15,7 @@ else()
set(MoleQueue_LIB_DIR "${INSTALL_LIBRARY_DIR}")
endif()

find_package(Python QUIET COMPONENTS Interpreter)
find_package(Python3 QUIET COMPONENTS Interpreter)

include(GenerateExportHeader)

Expand Down Expand Up @@ -166,16 +166,16 @@ if(WIN32)
list(APPEND mq_srcs puttycommand.cpp)
endif()

qt5_wrap_ui(ui_srcs ${ui_files})
qt6_wrap_ui(ui_srcs ${ui_files})

qt5_add_resources(rcc_srcs queuetray.qrc)
qt6_add_resources(rcc_srcs queuetray.qrc)

add_library(molequeue_static STATIC ${mq_srcs} ${ui_srcs})
set_target_properties(molequeue_static PROPERTIES AUTOMOC TRUE)
target_link_libraries(molequeue_static MoleQueueServerCore Qt5::Core Qt5::Widgets Qt5::Network)
target_link_libraries(molequeue_static MoleQueueServerCore Qt6::Core Qt6::Core5Compat Qt6::Widgets Qt6::Network)

if(MoleQueue_USE_EZHPC_UIT)
target_link_libraries(molequeue_static KDSoap::kdsoap Qt5::XmlPatterns)
target_link_libraries(molequeue_static KDSoap::kdsoap Qt6::XmlPatterns)
endif()

if(MoleQueue_BUILD_CLIENT)
Expand All @@ -195,9 +195,9 @@ elseif(WIN32)
endif()

add_executable(molequeue WIN32 MACOSX_BUNDLE ${sources} ${rcc_srcs})
target_link_libraries(molequeue molequeue_static Qt5::Core Qt5::Widgets Qt5::Network)
target_link_libraries(molequeue molequeue_static Qt6::Core Qt6::Widgets Qt6::Network)
if(WIN32)
target_link_libraries(molequeue Qt5::WinMain)
target_link_libraries(molequeue Qt6::EntryPointPrivate)
endif()
if(APPLE)
set_target_properties(molequeue PROPERTIES
Expand Down
6 changes: 3 additions & 3 deletions molequeue/app/addqueuedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "queuemanager.h"

#include <QtWidgets/QMessageBox>
#include <QtGui/QRegExpValidator>
#include <QtGui/QRegularExpressionValidator>

namespace MoleQueue {

Expand All @@ -38,8 +38,8 @@ AddQueueDialog::AddQueueDialog(QueueManager *queueManager,

// Restrict queue names to alphanumeric strings with internal whitespace
// (the input is trimmed() in accept()).
ui->nameLineEdit->setValidator(new QRegExpValidator(
QRegExp(VALID_NAME_REG_EXP)));
ui->nameLineEdit->setValidator(new QRegularExpressionValidator(
QRegularExpression(VALID_NAME_REG_EXP)));
}

AddQueueDialog::~AddQueueDialog()
Expand Down
13 changes: 6 additions & 7 deletions molequeue/app/filebrowsewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

#include <QtWidgets/QCompleter>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QFileSystemModel>
#include <QtGui/QFileSystemModel>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>

#include <QtCore/QFileInfo>
#include <QtCore/QProcessEnvironment>
#include <QtCore/QRegExp>
#include <QtCore5Compat/QRegExp>

namespace MoleQueue {

Expand Down Expand Up @@ -173,15 +173,14 @@ QString FileBrowseWidget::searchSystemPathForFile(const QString &exec)
if (!env.contains("PATH"))
return result;

static QRegExp pathSplitter = QRegExp(
static const QChar pathSplitter =
#ifdef Q_OS_WIN32
";"
QLatin1Char(';');
#else // WIN32
":"
QLatin1Char(':');
#endif// WIN32
);
QStringList paths =
env.value("PATH").split(pathSplitter, QString::SkipEmptyParts);
env.value("PATH").split(pathSplitter, Qt::SkipEmptyParts);

foreach (const QString &path, paths) {
QFileInfo info(path + "/" + exec);
Expand Down
6 changes: 3 additions & 3 deletions molequeue/app/importqueuedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QMessageBox>
#include <QtGui/QPalette>
#include <QtGui/QRegExpValidator>
#include <QtGui/QRegularExpressionValidator>

#include <QtCore/QSettings>

Expand All @@ -43,8 +43,8 @@ ImportQueueDialog::ImportQueueDialog(QueueManager *queueManager, QWidget *parent

// Restrict queue names to alphanumeric strings with internal whitespace
// (the input is trimmed() in accept()).
ui->nameEdit->setValidator(new QRegExpValidator(
QRegExp(VALID_NAME_REG_EXP)));
ui->nameEdit->setValidator(new QRegularExpressionValidator(
QRegularExpression(VALID_NAME_REG_EXP)));
}

ImportQueueDialog::~ImportQueueDialog()
Expand Down
2 changes: 1 addition & 1 deletion molequeue/app/jobactionfactories/killjobactionfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "../queuemanager.h"
#include "../server.h"

#include <QtWidgets/QAction>
#include <QtGui/QAction>
#include <QtWidgets/QMessageBox>

Q_DECLARE_METATYPE(QList<MoleQueue::Job>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "../job.h"

#include <QtWidgets/QAction>
#include <QtGui/QAction>
#include <QtGui/QDesktopServices>

#include <QtCore/QUrl>
Expand Down
4 changes: 2 additions & 2 deletions molequeue/app/jobactionfactories/openwithactionfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "../queuemanager.h"
#include "../server.h"

#include <QtWidgets/QAction>
#include <QtGui/QAction>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QProgressDialog>
Expand Down Expand Up @@ -269,7 +269,7 @@ void OpenWithActionFactory::readSettings(QSettings &settings)
int numPatterns = settings.beginReadArray("patterns");
for (int i = 0; i < numPatterns; ++i) {
settings.setArrayIndex(i);
m_filePatterns << settings.value("regexp").toRegExp();
m_filePatterns << settings.value("regexp").value<QRegExp>();
}
settings.endArray();
}
Expand Down
2 changes: 2 additions & 0 deletions molequeue/app/jobactionfactories/openwithactionfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "molequeueglobal.h"

#include <QtCore5Compat/QRegExp>

class QDir;

namespace MoleQueue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "../jobmanager.h"
#include "../server.h"

#include <QtWidgets/QAction>
#include <QtGui/QAction>
#include <QtWidgets/QMessageBox>

Q_DECLARE_METATYPE(QList<MoleQueue::Job>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "logwindow.h"
#include "job.h"

#include <QtWidgets/QAction>
#include <QtGui/QAction>

Q_DECLARE_METATYPE(QList<MoleQueue::Job>)

Expand Down
10 changes: 5 additions & 5 deletions molequeue/app/jobtableproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,23 +202,23 @@ bool JobTableProxyModel::filterAcceptsRow(int sourceRow,
}

if (!m_filterString.isEmpty()) {
QStringList filterTerms = m_filterString.split(QRegExp("\\s+"),
QString::SkipEmptyParts);
QStringList filterTerms = m_filterString.split(QRegularExpression("\\s+"),
Qt::SkipEmptyParts);
foreach (QString fullTerm, filterTerms) {
bool termMatch = false;
bool isNegated = false;

QStringRef term(&fullTerm);
QStringView term(fullTerm);
// terms starting with '-' should not be present
if (term.startsWith('-')) {
isNegated = true;
term = fullTerm.midRef(1);
term = QStringView(fullTerm).mid(1);
}
Comment on lines 213 to 216
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard against empty negated terms ("-").

If a token is just "-", Line 215 produces an empty term and contains("") matches everything, so rows are incorrectly filtered out. Skip empty terms after removing -.

Proposed fix
       if (term.startsWith('-')) {
         isNegated = true;
         term = QStringView(fullTerm).mid(1);
+        if (term.isEmpty())
+          continue;
       }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@molequeue/app/jobtableproxymodel.cpp` around lines 213 - 216, When handling
negated tokens in the filtering code, guard against a token that's just "-" by
checking the term after stripping the leading '-' (the result of
QStringView(fullTerm).mid(1)) and skipping it if empty so you don't call
contains(""); update the logic around isNegated/term to continue/ignore empty
terms after removing the '-' (i.e., if term.isEmpty() after the mid(1) call, do
not treat it as a valid filter term).


for (int i = 0; i < static_cast<int>(sourceModel()->columnCount()); ++i) {
const QVariant disp = sourceModel()->data(
sourceModel()->index(sourceRow, i), Qt::DisplayRole);
if (disp.canConvert(QVariant::String)) {
if (disp.canConvert<QString>()) {
if (disp.toString().contains(term, Qt::CaseInsensitive)) {
termMatch = true;
break;
Expand Down
4 changes: 2 additions & 2 deletions molequeue/app/jobview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ JobView::~JobView()
void JobView::contextMenuEvent(QContextMenuEvent *e)
{
// list of action factories. Map to sort by usefulness
QMap<unsigned int, JobActionFactory*> factoryMap;
QMultiMap<unsigned int, JobActionFactory*> factoryMap;
ActionFactoryManager *manager = ActionFactoryManager::instance();
foreach (JobActionFactory *factory,
manager->factories(JobActionFactory::ContextItem)) {
factoryMap.insertMulti(factory->usefulness(), factory);
factoryMap.insert(factory->usefulness(), factory);
}

// Get job under cursor
Expand Down
2 changes: 1 addition & 1 deletion molequeue/app/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "logentry.h"

#include <QtCore/QLinkedList>
#include <QtCore5Compat/QLinkedList>

class QFile;

Expand Down
3 changes: 2 additions & 1 deletion molequeue/app/logwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "logger.h"
#include "idtypeutils.h"

#include <QtCore/QRegularExpression>
#include <QtCore/QSettings>

#include <QtGui/QBrush>
Expand Down Expand Up @@ -176,7 +177,7 @@ void LogWindow::addLogEntry(const LogEntry &entry)
}
cur.insertText(" ");
// Modify newlines to align with the hanging indent.
cur.insertText(entry.message().replace(QRegExp("\\n+"), "\n "),
cur.insertText(entry.message().replace(QRegularExpression("\\n+"), "\n "),
*m_messageFormat);
cur.endEditBlock();
}
Expand Down
4 changes: 2 additions & 2 deletions molequeue/app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <QtGui/QKeyEvent>
#include <QtWidgets/QLabel>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QShortcut>
#include <QtGui/QShortcut>
#include <QtWidgets/QStatusBar>

namespace MoleQueue {
Expand Down Expand Up @@ -318,7 +318,7 @@ void MainWindow::updateJobCounts(int totalJobs, int shownJobs)
m_statusHiddenJobs->setText(tr("%n job(s) are hidden by filters", "",
hiddenJobs));
QPalette pal;
pal.setColor(QPalette::Foreground, Qt::darkRed);
pal.setColor(QPalette::WindowText, Qt::darkRed);
m_statusHiddenJobs->setPalette(pal);
m_statusHiddenJobs->show();
}
Expand Down
11 changes: 5 additions & 6 deletions molequeue/app/openwithmanagerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <QtWidgets/QCompleter>
#include <QtWidgets/QDataWidgetMapper>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QFileSystemModel>
#include <QtGui/QFileSystemModel>
#include <QtWidgets/QHeaderView>
#include <QtCore/QItemSelectionModel>
#include <QtGui/QKeyEvent>
Expand Down Expand Up @@ -608,15 +608,14 @@ QString OpenWithManagerDialog::searchSystemPathForFile(const QString &exec)
if (!env.contains("PATH"))
return result;

static QRegExp pathSplitter = QRegExp(
static const QChar pathSplitter =
#ifdef Q_OS_WIN32
";"
QLatin1Char(';');
#else // WIN32
":"
QLatin1Char(':');
#endif// WIN32
);
QStringList paths =
env.value("PATH").split(pathSplitter, QString::SkipEmptyParts);
env.value("PATH").split(pathSplitter, Qt::SkipEmptyParts);

foreach (const QString &path, paths) {
QFileInfo info(QUrl::fromLocalFile(path + "/" + exec).toLocalFile());
Expand Down
1 change: 1 addition & 0 deletions molequeue/app/openwithmanagerdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <QtWidgets/QDialog>

#include <QtCore/QModelIndexList>
#include <QtCore5Compat/QRegExp>

class QAbstractButton;
class QDataWidgetMapper;
Expand Down
12 changes: 6 additions & 6 deletions molequeue/app/openwithpatternmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "openwithpatternmodel.h"

#include <QtCore/QRegExp>
#include <QtCore5Compat/QRegExp>

namespace MoleQueue
{
Expand Down Expand Up @@ -120,7 +120,7 @@ bool OpenWithPatternModel::setData(const QModelIndex &ind,
QRegExp &regexp = (*m_regexps)[ind.row()];

if (role == Qt::CheckStateRole) {
if (value.canConvert(QVariant::Int)) {
if (value.canConvert<int>()) {
Qt::CheckState state = static_cast<Qt::CheckState>(value.toInt());
if (ind.column() == CaseSensitivityCol) {
regexp.setCaseSensitivity(state == Qt::Checked ? Qt::CaseSensitive
Expand All @@ -129,7 +129,7 @@ bool OpenWithPatternModel::setData(const QModelIndex &ind,
return true;
}
}
if (value.canConvert(QVariant::Bool)) {
if (value.canConvert<bool>()) {
if (ind.column() == CaseSensitivityCol) {
regexp.setCaseSensitivity(value.toBool() ? Qt::CaseSensitive
: Qt::CaseInsensitive);
Expand All @@ -144,7 +144,7 @@ bool OpenWithPatternModel::setData(const QModelIndex &ind,

switch (static_cast<ColumnType>(ind.column())) {
case PatternCol:
if (value.canConvert(QVariant::String)) {
if (value.canConvert<QString>()) {
regexp.setPattern(value.toString());
emit dataChanged(ind, ind);
return true;
Expand All @@ -154,7 +154,7 @@ bool OpenWithPatternModel::setData(const QModelIndex &ind,
}

case PatternTypeCol:
if (value.type() == QVariant::String) {
if (value.typeId() == QMetaType::QString) {
QString str = value.toString().simplified();
if (!str.isEmpty()) {
QChar firstChar = str.at(0).toLower();
Expand Down Expand Up @@ -187,7 +187,7 @@ bool OpenWithPatternModel::setData(const QModelIndex &ind,
return false;

case CaseSensitivityCol:
if (value.canConvert(QVariant::Bool)) {
if (value.canConvert<bool>()) {
regexp.setCaseSensitivity(value.toBool() ? Qt::CaseSensitive
: Qt::CaseInsensitive);
emit dataChanged(ind, ind);
Expand Down
2 changes: 1 addition & 1 deletion molequeue/app/openwithpatternmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define MOLEQUEUE_OPENWITHPATTERNMODEL_H

#include <QtCore/QAbstractItemModel>
#include <QtCore/QRegExp>
#include <QtCore5Compat/QRegExp>
#include <QtCore/QList>

namespace MoleQueue {
Expand Down
Loading