comparison src/common.h @ 370:b9c153e00e84

Move source files to src/
author Chris Cannam
date Thu, 24 Mar 2011 10:27:51 +0000
parents common.h@8fd71f570884
children 005633eed862
comparison
equal deleted inserted replaced
369:19cce6d2c470 370:b9c153e00e84
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 EasyMercurial
5
6 Based on HgExplorer by Jari Korhonen
7 Copyright (c) 2010 Jari Korhonen
8 Copyright (c) 2011 Chris Cannam
9 Copyright (c) 2011 Queen Mary, University of London
10
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version. See the file
15 COPYING included with this distribution for more information.
16 */
17
18 #ifndef COMMON_H
19 #define COMMON_H
20
21 #include <QString>
22
23 #define MY_ICON_SIZE 32
24 //!!!:
25 #define REPOMENU_TITLE "Repository actions"
26 #define WORKFOLDERMENU_TITLE "Workfolder actions"
27
28 extern QString findInPath(QString name, QString installPath, bool executable);
29
30 extern QString getSystem();
31 extern QString getHgDirName();
32
33 extern QString getUserRealName();
34
35 extern void loseControllingTerminal();
36
37 void installSignalHandlers();
38
39 /**
40 * Status used in testing whether a folder argument (received from the
41 * user) is valid for particular uses.
42 */
43 enum FolderStatus {
44 FolderUnknown, /// Neither the folder nor its parent exists
45 FolderParentExists, /// The folder is absent, but its parent exists
46 FolderExists, /// The folder exists and has no .hg repo in it
47 FolderHasRepo, /// The folder exists and has an .hg repo in it
48 FolderIsFile /// The "folder" is actually a file
49 };
50
51 FolderStatus getFolderStatus(QString path);
52
53 /**
54 * If the given path is somewhere within an existing repository,
55 * return the path of the root directory of the repository (i.e. the
56 * one with .hg in it).
57 *
58 * If the given path is _not_ in a repository, or the given path _is_
59 * the root directory of a repository, return QString(). Use
60 * getFolderStatus to distinguish between these cases.
61 */
62 QString getContainingRepoFolder(QString path);
63
64 QString xmlEncode(QString);
65
66
67 #endif //COMMON_H
68
69