Introduce a mechanism to test for certain core features
[quassel.git] / src / common / quassel.cpp
index deaf20e..e6e2072 100644 (file)
@@ -76,7 +76,7 @@ bool Quassel::init() {
     // we only handle crashes ourselves if coredumps are disabled
     struct rlimit *limit = (rlimit *) malloc(sizeof(struct rlimit));
     int rc = getrlimit(RLIMIT_CORE, limit);
-  
+
     if(rc == -1 || !((long)limit->rlim_cur > 0 || limit->rlim_cur == RLIM_INFINITY)) {
 # endif /* Q_OS_WIN32 */
       signal(SIGABRT, handleSignal);
@@ -246,6 +246,14 @@ void Quassel::logFatalMessage(const char *msg) {
 #endif
 }
 
+Quassel::Features Quassel::features() {
+  Features feats = 0;
+  for(int i = 1; i <= NumFeatures; i<<=1)
+    feats |= (Feature) i;
+
+  return feats;
+}
+
 const QString &Quassel::coreDumpFileName() {
   if(_coreDumpFileName.isEmpty()) {
     QDir configDir(configDirPath());