~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to qcm/aspell.qcm

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
-----BEGIN QCMOD-----
 
3
name: ASPELL
 
4
arg: with-aspell-inc=[path],Path to Aspell include files
 
5
arg: with-aspell-lib=[path],Path to Aspell library files
 
6
-----END QCMOD-----
 
7
*/
 
8
 
 
9
//----------------------------------------------------------------------------
 
10
// qc_spell
 
11
//----------------------------------------------------------------------------
 
12
class qc_aspell : public ConfObj
 
13
{
 
14
public:
 
15
        qc_aspell(Conf *c) : ConfObj(c) {}
 
16
        QString name() const { return "Aspell support"; }
 
17
        QString shortname() const { return "aspell"; }
 
18
        bool exec()
 
19
        {
 
20
                QString s;
 
21
 
 
22
                s = conf->getenv("QC_WITH_ASPELL_INC");
 
23
                if(!s.isEmpty()) {
 
24
                        if(!conf->checkHeader(s, "aspell.h")) {
 
25
                                conf->debug("Aspell includes not found!");
 
26
                                return false;
 
27
                        }
 
28
                        conf->addIncludePath(s);
 
29
                }
 
30
                else {
 
31
                        QStringList sl;
 
32
                        sl += "/usr/include";
 
33
                        sl += "/usr/local/include";
 
34
                        sl += "/sw/include";
 
35
                        if(!conf->findHeader("aspell.h", sl, &s)) {
 
36
                                conf->debug("Aspell includes not found!");
 
37
                                return false;
 
38
                        }
 
39
                        conf->addIncludePath(s);
 
40
                }
 
41
 
 
42
                s = conf->getenv("QC_WITH_ASPELL_LIB");
 
43
                if(!s.isEmpty()) {
 
44
                        if(!conf->checkLibrary(s, "aspell")) {
 
45
                                conf->debug("Aspell libraries not found!");
 
46
                                return false;
 
47
                        }
 
48
                        conf->addLib(QString("-L") + s);
 
49
                }
 
50
                else {
 
51
                        if(!conf->findLibrary("aspell", &s)) {
 
52
                                conf->debug("Aspell libraries not found!");
 
53
                                return false;
 
54
                        }
 
55
                        if (!s.isEmpty())
 
56
                                conf->addLib(QString("-L") + s);
 
57
                }
 
58
 
 
59
                conf->addLib("-laspell");
 
60
                conf->addDefine("HAVE_ASPELL");
 
61
 
 
62
                return true;
 
63
        }
 
64
};