summaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: 1d6e30da74c54dfa81ba551fae15124bf1e643e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* ============================================================
 *     The rekonq project
 * ============================================================
 * SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright (C) 2008-2013 by Andrea Diamantini <adjam7 at gmail dot com>
 * SPDX-License-Identifier: GPL-3.0-only
 * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
 * ============================================================
 * Description: Application Entry Point
 * ============================================================ */

#include "application.hpp"

int main(int argc, char **argv)
{
  // When loading QtWebEngine from a plugin, set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute
  QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);

  Application app(argc, argv);
  // Set application data
  QCoreApplication::setApplicationName(QL1S("rekonq"));
  QCoreApplication::setApplicationVersion(REKONQ_VERSION);

  if (app.isSecondary()) {
    app.sendMessage(Application::arguments().join('\n').toUtf8());
    return 0;
  }
  else
    app.parseCommandLine(app.instanceId(), {});

  /*

      if (app.isSessionRestored())
      {
          for (int i = 1; RekonqWindow::canBeRestored(i); i++)
          {
              RekonqWindow * newRekonqWindow = app.newWindow(false);
              if (newRekonqWindow->restore(i))
                  SessionManager::self()->restoreWindow(newRekonqWindow);
          }
      }
    */
  return Application::exec();
}