~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to src/tools/spellchecker/spellchecker.cpp

  • 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
 * spellchecker.cpp
 
3
 *
 
4
 * Copyright (C) 2006  Remko Troncon
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * You can also redistribute and/or modify this program under the
 
12
 * terms of the Psi License, specified in the accompanied COPYING
 
13
 * file, as published by the Psi Project; either dated January 1st,
 
14
 * 2005, or (at your option) any later version.
 
15
 *
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 *
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this library; if not, write to the Free Software
 
23
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
 *
 
25
 */
 
26
 
 
27
#include "spellchecker.h"
 
28
#if defined(Q_WS_MAC)
 
29
#include "macspellchecker.h"
 
30
#elif defined(HAVE_ASPELL)
 
31
#include "aspellchecker.h"
 
32
#endif
 
33
 
 
34
SpellChecker* SpellChecker::instance() 
 
35
{
 
36
        if (!instance_) {
 
37
#ifdef Q_WS_MAC
 
38
                instance_ = new MacSpellChecker();
 
39
#elif defined(HAVE_ASPELL)
 
40
                instance_ = new ASpellChecker();
 
41
#else
 
42
                instance_ = new SpellChecker();
 
43
#endif
 
44
        }
 
45
        return instance_;
 
46
}
 
47
 
 
48
SpellChecker::SpellChecker()
 
49
{
 
50
}
 
51
 
 
52
SpellChecker::~SpellChecker()
 
53
{
 
54
}
 
55
 
 
56
bool SpellChecker::available() const
 
57
{
 
58
        return false;
 
59
}
 
60
 
 
61
bool SpellChecker::writable() const
 
62
{
 
63
        return true;
 
64
}
 
65
 
 
66
bool SpellChecker::isCorrect(const QString&)
 
67
{
 
68
        return true;
 
69
}
 
70
 
 
71
QList<QString> SpellChecker::suggestions(const QString&)
 
72
{
 
73
        return QList<QString>();
 
74
}
 
75
 
 
76
bool SpellChecker::add(const QString&)
 
77
{
 
78
        return false;
 
79
}
 
80
 
 
81
SpellChecker* SpellChecker::instance_ = NULL;