File: testinit.cpp

package info (click to toggle)
kpmcore 24.12.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,696 kB
  • sloc: cpp: 20,700; sh: 22; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 753 bytes parent folder | download | duplicates (5)
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
/*
    SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
    SPDX-FileCopyrightText: 2018 Andrius Štikonas <andrius@stikonas.eu>
    SPDX-FileCopyrightText: 2019 Shubham Jangra <aryan100jangid@gmail.com>

    SPDX-License-Identifier: GPL-3.0-or-later
*/

// Initializes KPMcore, and either loads the default backend for
// the current platform, or if one is named on the command line,
// loads that one. Returns 0 on success.

#include <QCoreApplication>

#include "helpers.h"

int main( int argc, char** argv )
{
    QCoreApplication app(argc, argv);
    if ( argc != 2 ) {
        KPMCoreInitializer i;
        return i.isValid() ? 0 : 1;
    } else {
        KPMCoreInitializer i( argv[1] );
        return i.isValid() ? 0 : 1;
    }
}