Comments (5)
P.S. IDK why it has bug label, but I wasn't able to change labels upon issue creation.
from kdiskmark.
Would it be ok for me to create PR with something along this lines:
diff --git a/src/main.cpp b/src/main.cpp
index e300159..422d6c8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,6 +5,8 @@
#include "singleapplication.h"
#include "cmake.h"
+bool use_multi_instance(int argc, char *argv[]);
+
int main(int argc, char *argv[])
{
QCoreApplication::setApplicationName(QStringLiteral(PROJECT_NAME));
@@ -13,7 +15,12 @@ int main(int argc, char *argv[])
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- SingleApplication a(argc, argv);
+ std::unique_ptr<QApplication> a;
+ if (use_multi_instance(argc, argv)) {
+ a = std::make_unique<QApplication>(argc, argv);
+ } else {
+ a = std::make_unique<SingleApplication>(argc, argv);
+ }
AppSettings().setupLocalization();
@@ -21,5 +28,17 @@ int main(int argc, char *argv[])
w.setFixedSize(w.size());
w.show();
- return a.exec();
+ return a->exec();
}
+
+const std::string MULTI_INSTANCE_ARG = "--multi-instance";
+
+bool use_multi_instance(int argc, char *argv[])
+{
+ for (int i = 0; i < argc; ++i) {
+ if (argv[i] == MULTI_INSTANCE_ARG) {
+ return true;
+ }
+ }
+ return false;
+}
\ No newline at end of file
Command swith to be decided. And sorry for code stype. I've have to look at style used across the project etc.
But that's just a a sketch.
As I understand: before we created QApplication instance we can't use Qt's facility to parse arguments, so have to do it manually.
from kdiskmark.
Turns out this solution is better:
diff --git a/src/main.cpp b/src/main.cpp
index e300159..872bb6d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,6 +5,8 @@
#include "singleapplication.h"
#include "cmake.h"
+bool use_multi_instance(int argc, char *argv[]);
+
int main(int argc, char *argv[])
{
QCoreApplication::setApplicationName(QStringLiteral(PROJECT_NAME));
@@ -13,7 +15,7 @@ int main(int argc, char *argv[])
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- SingleApplication a(argc, argv);
+ SingleApplication a(argc, argv, use_multi_instance(argc, argv));
AppSettings().setupLocalization();
@@ -23,3 +25,15 @@ int main(int argc, char *argv[])
return a.exec();
}
+
+const std::string MULTI_INSTANCE_ARG = "--multi-instance";
+
+bool use_multi_instance(int argc, char *argv[])
+{
+ for (int i = 0; i < argc; ++i) {
+ if (argv[i] == MULTI_INSTANCE_ARG) {
+ return true;
+ }
+ }
+ return false;
+}
\ No newline at end of file
from kdiskmark.
I jsut got thought. Would this create problems with helper?
from kdiskmark.
I jsut got thought. Would this create problems with helper?
This can cause problems when running simultaneous tests. But the flag idea is a good one.
from kdiskmark.
Related Issues (20)
- installing Kdiskmark removes too many existing packages HOT 2
- Kdismark HOT 1
- RND4KQ32T16 Bug HOT 2
- CrystalDiskMark compatibility profile HOT 2
- Suggestion: Not using decimals in the results?
- What fio commands are being used? HOT 3
- Using outdated Flatpak runtime versions HOT 3
- Sometimes can't run certain tests.. HOT 5
- Why SingleApplication?.. HOT 1
- Comparable to CrystalDiskMark?.. HOT 1
- kdiskmark is giving inaccurate readings? HOT 2
- `fio` results for RND4K Q32T16 are ~2x higher HOT 1
- Benchmarking non-traditional mount points HOT 4
- "An error occurred while creating the benchmark file" HOT 1
- Feat: set NoCow for Btrfs/Bcachefs
- Android Support
- Why do the benchmark test results between KDiskMark and Gnome Disks not match? HOT 1
- Consider switching to Qt 6 HOT 2
- Can not install on RasbPi4 running raspOS-debian HOT 2
- What unit we actually use for measurement? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kdiskmark.