PageRenderTime 38ms CodeModel.GetById 23ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/guitone-1.0rc5/src/monotone/MonotoneUtil.h

#
C Header | 68 lines | 41 code | 9 blank | 18 comment | 0 complexity | 279535509ef7c0d6a5f64f971d829257 MD5 | raw file
Possible License(s): GPL-3.0
 1/***************************************************************************
 2 *   Copyright (C) 2007 by Thomas Keller                                   *
 3 *   me@thomaskeller.biz                                                   *
 4 *                                                                         *
 5 *   This program is free software; you can redistribute it and/or modify  *
 6 *   it under the terms of the GNU General Public License as published by  *
 7 *   the Free Software Foundation, either version 3 of the License, or     *
 8 *   (at your option) any later version.                                   *
 9 *                                                                         *
10 *   This program is distributed in the hope that it will be useful,       *
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13 *   GNU General Public License for more details.                          *
14 *                                                                         *
15 *   You should have received a copy of the GNU General Public License     *
16 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
18
19#ifndef MONOTONE_UTIL_H
20#define MONOTONE_UTIL_H
21
22#include "vocab.h"
23#include "CertList.h"
24#include "MonotoneThread.h"
25
26#include <QEventLoop>
27
28class MonotoneUtil : public QObject
29{
30    Q_OBJECT
31public:
32    static void runSynchronousTask(const MonotoneHandlePtr &, const MonotoneTaskPtr &);
33    static QString getBaseWorkspaceRevision(const MonotoneHandlePtr &);
34    static QString getOption(const MonotoneHandlePtr &, const QString &);
35    static QString getBranchName(const MonotoneHandlePtr &, const QString & defaultBranch = tr("[unknown branch]"));
36    static QString getBranchNameShort(const MonotoneHandlePtr &);
37    static QStringList resolveSelector(const MonotoneHandlePtr &, const QString &);
38    static CertList getCerts(const MonotoneHandlePtr &, const QString &);
39    static bool createCert(const MonotoneHandlePtr & db, const QString &, const QString &, const QString &, const QString &);
40    static FileEntryList getRevisionManifest(const MonotoneHandlePtr &, const QString &);
41    static QMap<QString, QString> getPublicKeyMap(const MonotoneHandlePtr &);
42    static QMap<QString, QString> getPrivateKeyMap(const MonotoneHandlePtr &);
43    static QStringList getPreviousContentMarks(const MonotoneHandlePtr &, const QString &, const QString &);
44    static QString getCorrespondingPath(const MonotoneHandlePtr &, const QString &, const QString &, const QString &);
45    static QString getFileId(const MonotoneHandlePtr &, const QString &);
46    static QStringList getRoots(const MonotoneHandlePtr &, bool &);
47    static QStringList topsortRevisions(const MonotoneHandlePtr &, const QStringList &);
48    static QStringList getCommonAncestors(const MonotoneHandlePtr &, const QStringList &);
49    static QStringList getDefaultDatabaseLocations(const MonotoneHandlePtr &);
50    static bool getFileAttribute(const MonotoneHandlePtr &, const QString &, const QString &, const QString &, QPair<QString, QString> &);
51    static QMap<QString, QString> getDatabaseVariables(const MonotoneHandlePtr &, const QString &);
52
53    // FIXME: decide what to do with that
54    static QString stripMtnPrefix(const QString &);
55
56signals:
57    void finished();
58
59private:
60    void run(const MonotoneThreadPtr &, const MonotoneTaskPtr &);
61    int currentCommandNumber;
62
63private slots:
64    void taskFinished(const MonotoneTaskPtr &);
65    void taskAborted(const MonotoneTaskPtr &);
66};
67
68#endif