diff --git a/INSTALL.w64 b/INSTALL.w64 index 934e888a..ad6ad53e 100644 --- a/INSTALL.w64 +++ b/INSTALL.w64 @@ -1,30 +1,22 @@ -This is a short overview of how to build -XCA for windows 64-bit. +Since the switch to CMAKE a native compilation on Windows +is possible. -This is for debian hosts, cross-compiling a windows binary. +Required: + QT via Maintainance tool: + Qt -> 5.15.2 -> MingW-64bit + -> Qt Creator + -> MingW + -> Cmake + -> Ninja -Needed packages: - mingw cross compiler - wine (to run moc.exe and uic.exe) + OpenSSL: Win64OpenSSL_1_1_1k.msi -# apt-get install mingw-w64 wine +Optional for the documentation + Python3.9 via Microsoft Store + Inside Python console run "pip install sphinx" -create a new, empty directory say xca-w64 -$ cd xca-w64 -$ tar zxf xca-0.x.y.tar.gz +Add the C:\Qt\5.15.2\mingw81_64\bin and the path shown by pip +to your %PATH% environment -Use a Windows host to execute and install the QT5 tools -The required component is: Qt5 / MinGW 64-bit -https://www.qt.io/download - -./bootstrap -touch build-libs - -comment out OSSLSIGN line in Makefile - -copy the installed Qt tree from windows host to ./qt/ - -Edit the Qt path in xca-x.y.z/release/build-w64.sh -Now call xca-x.y.z/release/build-w64.sh -and wait until xca-portable-x.y.z is built. +Open XCA in the Qt Creator and GO diff --git a/lib/base.h b/lib/base.h index c89bc109..d4cf97c9 100644 --- a/lib/base.h +++ b/lib/base.h @@ -20,7 +20,7 @@ #define CCHAR(x) qPrintable(x) -#define C_FILE ((strrchr(__FILE__, '/') ? : __FILE__- 1) + 1) +#define C_FILE ((strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') : __FILE__- 1) + 1) #define TRACE qDebug("File: %s Func: %s Line: %d", C_FILE, __func__, __LINE__); #define nativeSeparator(s) QDir::toNativeSeparators(s) diff --git a/lib/dbhistory.cpp b/lib/dbhistory.cpp index 9d25ff4d..019d2014 100644 --- a/lib/dbhistory.cpp +++ b/lib/dbhistory.cpp @@ -32,11 +32,11 @@ dbhistory::dbhistory() history.clear(); while (!file.atEnd()) { - char buf[1024]; - ssize_t size = file.readLine(buf, sizeof buf); - if (size <= 0) + QByteArray ba; + ba = file.readLine(1024); + if (ba.size() == 0) break; - name = QString::fromUtf8(buf).trimmed(); + name = QString::fromUtf8(ba).trimmed(); if (name.size() == 0) continue; if (history.indexOf(name) == -1) diff --git a/lib/pki_multi.cpp b/lib/pki_multi.cpp index db8ae33a..79871219 100644 --- a/lib/pki_multi.cpp +++ b/lib/pki_multi.cpp @@ -156,7 +156,7 @@ void pki_multi::probeAnything(const QString &fname) append_item(item); break; } - } catch (errorEx &err) { + } catch (errorEx &) { continue; } catch (enum open_result r) { if (r == pw_cancel) diff --git a/lib/xfile.h b/lib/xfile.h index a85a541a..6c98e0dd 100644 --- a/lib/xfile.h +++ b/lib/xfile.h @@ -8,10 +8,18 @@ #ifndef __X_FILE_H #define __X_FILE_H +#define _CRT_SECURE_NO_WARNINGS + #include #include #include +#if defined (Q_CC_MSVC) +#include +#include +typedef int mode_t; +#else #include +#endif #include #include diff --git a/widgets/CertDetail.cpp b/widgets/CertDetail.cpp index d965cd44..9e5cd1cc 100644 --- a/widgets/CertDetail.cpp +++ b/widgets/CertDetail.cpp @@ -21,7 +21,7 @@ #include CertDetail::CertDetail(QWidget *w) - : QDialog(w ?: mainwin), keySqlId(), issuerSqlId(), thisSqlId() + : QDialog(w ? w : mainwin), keySqlId(), issuerSqlId(), thisSqlId() { setupUi(this); setWindowTitle(XCA_TITLE); diff --git a/widgets/CrlDetail.cpp b/widgets/CrlDetail.cpp index ed6127f7..3444c5dd 100644 --- a/widgets/CrlDetail.cpp +++ b/widgets/CrlDetail.cpp @@ -21,7 +21,7 @@ #include CrlDetail::CrlDetail(QWidget *w) - : QDialog(w ?: mainwin), issuerSqlId(), crlSqlId() + : QDialog(w ? w : mainwin), issuerSqlId(), crlSqlId() { setupUi(this); setWindowTitle(XCA_TITLE); diff --git a/widgets/ExportDialog.cpp b/widgets/ExportDialog.cpp index 24f2c0c9..16291878 100644 --- a/widgets/ExportDialog.cpp +++ b/widgets/ExportDialog.cpp @@ -22,7 +22,7 @@ ExportDialog::ExportDialog(QWidget *w, const QString &title, const QString &filt, pki_base *pki, const QPixmap &img, QList types, const QString &help_ctx) - : QDialog(w ?: mainwin) + : QDialog(w ? w : mainwin) { setupUi(this); setWindowTitle(XCA_TITLE); diff --git a/widgets/ImportMulti.cpp b/widgets/ImportMulti.cpp index 2ef3be6a..03e135a1 100644 --- a/widgets/ImportMulti.cpp +++ b/widgets/ImportMulti.cpp @@ -30,7 +30,7 @@ #include ImportMulti::ImportMulti(QWidget *parent) - : QDialog(parent ?: mainwin) + : QDialog(parent ? parent : mainwin) { setupUi(this); setWindowTitle(XCA_TITLE); diff --git a/widgets/KeyDetail.cpp b/widgets/KeyDetail.cpp index 37f041ea..a502fcf2 100644 --- a/widgets/KeyDetail.cpp +++ b/widgets/KeyDetail.cpp @@ -23,7 +23,7 @@ #include KeyDetail::KeyDetail(QWidget *w) - : QDialog(w ?: mainwin) , keySqlId() + : QDialog(w ? w : mainwin) , keySqlId() { setupUi(this); setWindowTitle(XCA_TITLE); diff --git a/widgets/NewCrl.cpp b/widgets/NewCrl.cpp index 75e206c0..284fb0b4 100644 --- a/widgets/NewCrl.cpp +++ b/widgets/NewCrl.cpp @@ -19,7 +19,7 @@ #include NewCrl::NewCrl(const crljob &j, QWidget *w) - : QWidget(w ?: mainwin), task(j) + : QWidget(w ? w : mainwin), task(j) { pki_x509 *issuer = task.issuer; pki_key *key = issuer->getRefKey(); diff --git a/widgets/NewKey.cpp b/widgets/NewKey.cpp index 8877ada2..8b655bf0 100644 --- a/widgets/NewKey.cpp +++ b/widgets/NewKey.cpp @@ -84,7 +84,7 @@ class keyListItem Q_DECLARE_METATYPE(keyListItem); NewKey::NewKey(QWidget *parent, const QString &name) - :QDialog(parent ?: mainwin) + :QDialog(parent ? parent : mainwin) { static const QList sizeList = { 1024, 2048, 4096, 8192 }; slotidList p11_slots; diff --git a/widgets/NewX509.cpp b/widgets/NewX509.cpp index 3aeecfee..162d40c4 100644 --- a/widgets/NewX509.cpp +++ b/widgets/NewX509.cpp @@ -107,7 +107,7 @@ QList NewX509::setupExplicitInputs(NIDlist nid_list, return edits; } -NewX509::NewX509(QWidget *w) : QDialog(w ?: mainwin) +NewX509::NewX509(QWidget *w) : QDialog(w ? w : mainwin) { int i; QStringList keys; diff --git a/widgets/RevocationList.cpp b/widgets/RevocationList.cpp index f10eb540..372a904c 100644 --- a/widgets/RevocationList.cpp +++ b/widgets/RevocationList.cpp @@ -93,7 +93,7 @@ void RevocationList::setupRevocationView(QTreeWidget *certList, certList->setSelectionMode(QAbstractItemView::ExtendedSelection); } -RevocationList::RevocationList(QWidget *w) : QDialog(w ?: mainwin) +RevocationList::RevocationList(QWidget *w) : QDialog(w ? w : mainwin) { QPushButton *genCrl; setupUi(this); diff --git a/widgets/XcaDialog.cpp b/widgets/XcaDialog.cpp index f5836793..fef88b73 100644 --- a/widgets/XcaDialog.cpp +++ b/widgets/XcaDialog.cpp @@ -18,7 +18,7 @@ static const char * const PixmapMap[] = { XcaDialog::XcaDialog(QWidget *parent, enum pki_type type, QWidget *w, const QString &t, const QString &desc, const QString &help_ctx) - : QDialog(parent ?: mainwin) + : QDialog(parent ? parent : mainwin) { setupUi(this); setWindowTitle(XCA_TITLE);