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

« back to all changes in this revision

Viewing changes to qcm/conf.qcm

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2006-01-20 00:20:36 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060120002036-7nw6yo6totip0ee5
Tags: 0.10-2
* Added upstream changelog (Closes: Bug#327748)
* Mention --no-gpg and --no-gpg-agent in manpage (Closes: Bug#204416)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
-----BEGIN QCMOD-----
 
3
name: Psi Configuration
 
4
-----END QCMOD-----
 
5
*/
 
6
 
 
7
//----------------------------------------------------------------------------
 
8
// qc_conf
 
9
//----------------------------------------------------------------------------
 
10
class qc_conf : public ConfObj
 
11
{
 
12
public:
 
13
        qc_conf(Conf *c) : ConfObj(c) {}
 
14
        QString name() const { return "Psi Configuration"; }
 
15
        QString shortname() const { return "conf"; }
 
16
        QString checkString() const { return "Writing configuration ..."; }
 
17
        bool exec()
 
18
        {
 
19
                conf->addExtra(QString("PREFIX=%1").arg(conf->getenv("PREFIX")));
 
20
                conf->addExtra(QString("DATADIR=%1/psi").arg(conf->getenv("DATADIR")));
 
21
 
 
22
                QFile file("src/config.h");
 
23
                if ( file.open( IO_WriteOnly ) ) {
 
24
                        QTextStream stream( &file );
 
25
                        stream << "#define PSI_DATADIR \"" << conf->getenv("DATADIR") << "/psi\"" << endl;
 
26
                }
 
27
                
 
28
                conf->addDefine("HAVE_CONFIG");
 
29
                
 
30
                return true;
 
31
        }
 
32
};