38 CPLSetErrorHandler(CPLQuietErrorHandler);
40 catch(std::exception &e) {
41 QString msg =
"Failed to load GDAL Drivers, with error [" + QString(e.what()) +
"]";
42 throw IException(IException::Unknown, msg, _FILEINFO_);
45 for (
int i = 1; i < argc; i++) {
47 if (arg.startsWith(
"-pref")) {
50 int nextIndex = i + 1;
52 if (nextIndex < argc) {
53 FileName preferenceFile(argv[nextIndex]);
54 QString filePath = preferenceFile.expanded();
55 Preference::Preferences().clear();
56 Preference::Preferences().Load(filePath);
59 QMessageBox::warning(NULL,
"Warning",
"Preference flag set but no preference file given.");
63 setlocale(LC_NUMERIC,
"en_US.UTF-8");
65 QDesktopServices::setUrlHandler(
"http",
this,
"openUrl");