~ubuntuone-control-tower/unity-scope-click/touch-15-04

« back to all changes in this revision

Viewing changes to scope/tests/click_interface_tool/click_interface_tool.cpp

  • Committer: Bileto Bot
  • Author(s): Rodney Dawes
  • Date: 2016-08-08 15:12:00 UTC
  • mfrom: (465.2.1 drop-getdotdesktopfilename)
  • Revision ID: ci-train-bot@canonical.com-20160808151200-rk4qdako0umvyskn
Remove some old unused code that is not needed any longer. (LP: #1289526)

Approved by: Charles Kerr, unity-api-1-bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2014 Canonical Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU General Public License version 3, as published
6
 
 * by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful, but
9
 
 * WITHOUT ANY WARRANTY; without even the implied warranties of
10
 
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
 
 * PURPOSE.  See the GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License along
14
 
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * In addition, as a special exception, the copyright holders give
17
 
 * permission to link the code of portions of this program with the
18
 
 * OpenSSL library under certain conditions as described in each
19
 
 * individual source file, and distribute linked combinations
20
 
 * including the two.
21
 
 * You must obey the GNU General Public License in all respects
22
 
 * for all of the code used other than OpenSSL.  If you modify
23
 
 * file(s) with this exception, you may extend this exception to your
24
 
 * version of the file(s), but you are not obligated to do so.  If you
25
 
 * do not wish to do so, delete this exception statement from your
26
 
 * version.  If you delete this exception statement from all source
27
 
 * files in the program, then also delete it here.
28
 
 */
29
 
 
30
 
#include <QCoreApplication>
31
 
#include <QDebug>
32
 
#include <QString>
33
 
#include <QTimer>
34
 
#include <QTextStream>
35
 
 
36
 
#include <iostream>
37
 
 
38
 
#include <click/interface.h>
39
 
#include <click/key_file_locator.h>
40
 
 
41
 
int main(int argc, char *argv[])
42
 
{
43
 
 
44
 
    QCoreApplication a(argc, argv);
45
 
    QSharedPointer<click::KeyFileLocator> keyFileLocator(new click::KeyFileLocator());
46
 
    click::Interface ci(keyFileLocator);
47
 
 
48
 
 
49
 
    QTimer timer;
50
 
    timer.setSingleShot(true);
51
 
 
52
 
    QObject::connect(&timer, &QTimer::timeout, [&]() {
53
 
            ci.get_dotdesktop_filename(std::string(argv[1]),
54
 
                                       [&a] (std::string val, click::InterfaceError error){
55
 
                                           if (error == click::InterfaceError::NoError) {
56
 
                                               std::cout << " Success, got dotdesktop:" << val << std::endl;
57
 
                                           } else {
58
 
                                               std::cout << " Error:" << val << std::endl;
59
 
                                           }
60
 
                                           a.quit();
61
 
                                       });
62
 
        } );
63
 
    
64
 
    timer.start(0);
65
 
        
66
 
    qInstallMessageHandler(0);
67
 
    return a.exec();
68
 
}
69