summaryrefslogtreecommitdiffstats
path: root/src/magiclabel.h
blob: 8db9fad69a32d0c877834ed6d8451144b3848d3a (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
/***************************************************************************
 *   Copyright (C) by                                                      *
 *     - 2005: Christian Leh <[email protected]>                             *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef MAGICLABEL_H
#define MAGICLABEL_H

#include <qstring.h>

#include <kprocess.h>

class MagicLabel : QObject
{
  Q_OBJECT

  private:
    QString prefix;
    QString preUSER;
    QString preCMD;

    QString mValue;

    void transform();
    void getUserInfo();
    void getCommandOutput();

  private slots:
    void processExited(KProcess* proc);
    void receivedStdout(KProcess *proc, char *buffer, int buflen);

  public:
    MagicLabel(QString s, bool translate);

    inline QString& value() { return mValue; };
};

#endif