summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp95
1 files changed, 19 insertions, 76 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 584c121..9eb8a4b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,87 +1,30 @@
-
+// Copyright 2013, University of Freiburg,
+// Author: Manuel Schneider <ms1144>
#include <QtGui/QApplication>
-#include <QString>
-#include <QDebug>
#include <fstream>
#include <iostream>
#include "widget.h"
-#include "config.h"
-#include "x.h"
-
-
-// Prototypes
-QString getIP ();
-
-void usage()
-{
-}
-
int main(int argc, char *argv[])
{
-// if (argc != 1)
-// std::cout << "Usage: " << argv[0] << " <config file>" << std::endl;
-// else {
-// // Check if file exists
-// std::ifstream f(argv[1]);
-// if (!f) {
-// std::cerr << "The config file does not exist." << std::endl;
-// exit(1);
-// }
-// else
-// f.close();
-// }
-
-// //Load settings
-// Config::inst()->loadSettings(argv[1]);
-// qDebug() << X::Screen::inst();
-
-
-// qDebug() << Config::inst()->getDisplay();
-// qDebug() << Config::inst()->getInterface();
-// qDebug() << Config::inst()->getIpSpecificXConf();
-// qDebug() << Config::inst()->getModeLines();
-// qDebug() << Config::inst()->getSettingsPath();
-
-
-// // Get initial data (to be freed)
-// Display *dpy = XOpenDisplay(NULL);
-// XRRScreenResources *sr = XRRGetScreenResourcesCurrent(dpy, DefaultRootWindow(dpy));
-
-
-
-
-// int X=1;RandR::
-// int M=1;
-
-// XRROutputInfo *output_first_info = XRRGetOutputInfo(dpy, sr, sr->outputs[X]);
-
-// // XRRSet
-// // HOLY
-// XRRSetCrtcConfig(dpy,
-// sr,
-// output_first_info->crtc,
-// CurrentTime,
-// 0, 0,
-// sr->modes[output_first_info->npreferred -1].id,
-// RR_Rotate_0,
-// &sr->outputs[X],
-// 1);
-
-
-
-
-
-
-
-
-
-
- QApplication a(argc, argv);
- Widget w;
- w.show();
- return a.exec();
+ if (argc != 1)
+ std::cout << "Usage: " << argv[0] << " <config file>" << std::endl;
+ else {
+ // Check if file exists
+ std::ifstream f(argv[1]);
+ if (!f) {
+ std::cerr << "The config file does not exist." << std::endl;
+ exit(1);
+ }
+ else
+ f.close();
+ }
+
+ QApplication a(argc, argv);
+ Widget w;
+ w.show();
+ return a.exec();
}