~ubuntu-branches/debian/jessie/xiphos/jessie

« back to all changes in this revision

Viewing changes to src/backend/sword_main.cc

  • Committer: Bazaar Package Importer
  • Author(s): Dmitrijs Ledkovs
  • Date: 2010-03-22 18:15:54 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100322181554-qlqchymwhcw28c0c
* New upstream release:
  + Bugfix only
  + Compatible with xulrunner 1.9.2
  + Update translations

* Revert changes introduced in 3.1.2-1ubuntu1. Thank you Chris Coulson
  for temporary fix.
* debian/xiphos.1 - spelling mistake
* waf is now default buildsystem
* help is now licensed under GPL
* Bumped standards version no changes required
* Changed email to @ubuntu.com

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Xiphos Bible Study Tool
3
 
 * sword_main.cc - 
 
3
 * sword_main.cc -
4
4
 *
5
5
 * Copyright (C) 2000-2009 Xiphos Developer Team
6
6
 *
55
55
BackEnd *backend = NULL;
56
56
 
57
57
 
58
 
 
59
 
#ifdef DEBUG 
 
58
 
 
59
#ifdef DEBUG
60
60
static const char *f_message = "backend/sword_main.cc line #%d \"%s\" = %s";
61
61
#endif
62
62
 
86
86
 
87
87
BackEnd::~BackEnd()
88
88
{
89
 
        if(main_mgr)
 
89
        if (main_mgr)
90
90
                delete main_mgr;
91
91
        main_mgr = 0;
92
92
        if (commDisplay)
120
120
void BackEnd::init_SWORD(int gsType)
121
121
{
122
122
        ModMap::iterator it;
123
 
        if(gsType == 0) {
124
 
                main_setup_displays();          
 
123
        if (gsType == 0) {
 
124
                main_setup_displays();
125
125
                for (it = main_mgr->Modules.begin();
126
126
                                        it != main_mgr->Modules.end(); it++) {
127
127
                        display_mod = (*it).second;
136
136
                        }
137
137
                        if (!strcmp(display_mod->Type(), BOOK_MODS)) {
138
138
                                display_mod->setDisplay(bookDisplay);
139
 
                        }                       
 
139
                        }
140
140
                }
141
 
        } else if(gsType == 1) { // dialogs
142
 
                for (it = main_mgr->Modules.begin(); it != main_mgr->Modules.end(); it++) {     
 
141
        } else if (gsType == 1) { // dialogs
 
142
                for (it = main_mgr->Modules.begin(); it != main_mgr->Modules.end(); it++) {
143
143
                        display_mod = (*it).second;
144
 
                        if (!strcmp(display_mod->Type(), TEXT_MODS)) {  
 
144
                        if (!strcmp(display_mod->Type(), TEXT_MODS)) {
145
145
                                display_mod->setDisplay(chapDisplay);
146
146
                        } else {
147
147
                                display_mod->setDisplay(entryDisplay);
148
148
                        }
149
 
                }       
150
 
        } else if(gsType == 2) { // search
151
 
                for (it = main_mgr->Modules.begin(); it != main_mgr->Modules.end(); it++) {     
 
149
                }
 
150
        } else if (gsType == 2) { // search
 
151
                for (it = main_mgr->Modules.begin(); it != main_mgr->Modules.end(); it++) {
152
152
                        display_mod = (*it).second;
153
153
                        display_mod->setDisplay(entryDisplay);
154
 
                }       
 
154
                }
155
155
        }
156
156
}
157
157
 
158
158
void BackEnd::init_lists(MOD_LISTS * mods)
159
159
{
160
160
        ModMap::iterator it;
161
 
        
 
161
 
162
162
        for (it = main_mgr->Modules.begin();
163
163
                                it != main_mgr->Modules.end(); it++) {
164
164
                if (!strcmp((*it).second->Type(), TEXT_MODS)) {
182
182
                                    , "RawFiles")) {
183
183
                                mods->percommods = g_list_append(mods->percommods,
184
184
                                    strdup((char *) (*it).second->Name()));
185
 
                        } 
 
185
                        }
186
186
                }
187
187
                if (!strcmp((*it).second->Type(), DICT_MODS)) {
188
188
                        char *feature =
203
203
                        }
204
204
                }
205
205
                if (!strcmp((*it).second->Type(), BOOK_MODS)) {
206
 
                        if ((*it).second->getConfigEntry("GSType") && 
 
206
                        if ((*it).second->getConfigEntry("GSType") &&
207
207
                                !strcmp((*it).second->getConfigEntry("GSType")
208
208
                                    , "PrayerList")) {
209
209
                                mods->prayermods = g_list_append(mods->prayermods,
244
244
GList *BackEnd::get_module_options(void)
245
245
{
246
246
        GList *options = NULL;
247
 
        StringList optionslist = main_mgr->getGlobalOptions();  
248
 
        for (StringList::iterator it = optionslist.begin(); 
 
247
        StringList optionslist = main_mgr->getGlobalOptions();
 
248
        for (StringList::iterator it = optionslist.begin();
249
249
                                  it != optionslist.end(); it++) {
250
250
                options = g_list_append(options, strdup((char *) (*it).c_str()));
251
251
        }
256
256
{
257
257
        SWModule *mod;
258
258
        ModMap::iterator it;
259
 
        //-- iterate through the modules until we find modName  
 
259
        //-- iterate through the modules until we find modName
260
260
        it = main_mgr->Modules.find(module_name);
261
261
        //-- if we find the module
262
262
        if (it != main_mgr->Modules.end()) {
272
272
                return NULL;
273
273
        SWModule *mod;
274
274
        ModMap::iterator it;
275
 
        //-- iterate through the modules until we find modName  
 
275
        //-- iterate through the modules until we find modName
276
276
        it = main_mgr->Modules.find(module_name);
277
277
        //-- if we find the module
278
278
        if (it != main_mgr->Modules.end()) {
285
285
 
286
286
void BackEnd::set_cipher_key(char * mod_name, char * key)
287
287
{
288
 
        main_mgr->setCipherKey(mod_name, key);  
 
288
        main_mgr->setCipherKey(mod_name, key);
289
289
}
290
290
 
291
291
int BackEnd::is_Bible_key(const char * list, char * current_key)
292
292
{
293
293
        VerseKey key;
294
 
        
 
294
 
295
295
        key.setText(current_key);
296
296
        ListKey vs = key.ParseVerseList(list, key);
297
297
        return vs.Count();
302
302
{
303
303
        SWModule *mod;
304
304
        ModMap::iterator it;
305
 
        //-- iterate through the modules until we find modName  
 
305
        //-- iterate through the modules until we find modName
306
306
        it = main_mgr->Modules.find(module_name);
307
307
        //-- if we find the module
308
308
        if (it != main_mgr->Modules.end()) {
310
310
                mod->setKey(key);
311
311
                return strdup((char *) mod->RenderText());
312
312
        }
313
 
        return NULL;    
 
313
        return NULL;
314
314
}
315
315
 
316
316
char *BackEnd::get_raw_text(const char *module_name, const char *key)
317
317
{
318
318
        SWModule *mod;
319
319
        ModMap::iterator it;
320
 
        //-- iterate through the modules until we find modName  
 
320
        //-- iterate through the modules until we find modName
321
321
        it = main_mgr->Modules.find(module_name);
322
322
        //-- if we find the module
323
323
        if (it != main_mgr->Modules.end()) {
325
325
                mod->setKey(key);
326
326
                return strdup((char *) mod->getRawEntry());
327
327
        }
328
 
        return NULL;    
 
328
        return NULL;
329
329
}
330
330
 
331
331
char *BackEnd::render_this_text(const char * module_name, const char * text)
332
332
{
333
333
        SWModule *mod;
334
334
        ModMap::iterator it;
335
 
        //-- iterate through the modules until we find modName  
 
335
        //-- iterate through the modules until we find modName
336
336
        it = main_mgr->Modules.find(module_name);
337
337
        //-- if we find the module
338
338
        if (it != main_mgr->Modules.end()) {
339
 
                mod = (*it).second;             
 
339
                mod = (*it).second;
340
340
                return strdup((char *) mod->RenderText(text));
341
341
        }
342
 
        return NULL;    
 
342
        return NULL;
343
343
}
344
344
 
345
345
char *BackEnd::get_strip_text_from_string(const char * module_name, const char *string)
346
346
{
347
347
        SWModule *mod;
348
348
        ModMap::iterator it;
349
 
        //-- iterate through the modules until we find modName  
 
349
        //-- iterate through the modules until we find modName
350
350
        it = main_mgr->Modules.find(module_name);
351
351
        //-- if we find the module
352
352
        if (it != main_mgr->Modules.end()) {
353
353
                mod = (*it).second;
354
354
                return strdup((char *) mod->StripText(string));
355
355
        }
356
 
        return NULL;    
 
356
        return NULL;
357
357
}
358
358
char *BackEnd::get_strip_text(const char *module_name, const char *key)
359
359
{
360
360
        SWModule *mod;
361
361
        ModMap::iterator it;
362
 
        //-- iterate through the modules until we find modName  
 
362
        //-- iterate through the modules until we find modName
363
363
        it = main_mgr->Modules.find(module_name);
364
364
        //-- if we find the module
365
365
        if (it != main_mgr->Modules.end()) {
367
367
                mod->setKey(key);
368
368
                return strdup((char *) mod->StripText());
369
369
        }
370
 
        return NULL;    
 
370
        return NULL;
371
371
}
372
372
 
373
373
 
374
374
char *BackEnd::get_valid_key(const char *key)
375
375
{
376
376
        VerseKey vkey;
377
 
        char *mykey;                                                 
 
377
        char *mykey;
378
378
        vkey.AutoNormalize(1);
379
379
        vkey = key;
380
 
        if((sword_locale) && (!strcmp(sword_locale,"en")))
 
380
        if ((sword_locale) && (!strcmp(sword_locale,"en")))
381
381
                mykey = (char*)vkey.getShortText();
382
382
        else
383
383
                mykey = (char*)vkey.getText();
389
389
        VerseKey vkey;
390
390
        vkey.AutoNormalize(1);
391
391
        vkey = key;
392
 
        
 
392
 
393
393
#ifdef SWORD_MULTIVERSE
394
394
        return strdup((char*)vkey.getBookName());
395
395
#else
419
419
        VerseKey vkey;
420
420
        vkey.AutoNormalize(1);
421
421
        vkey = key;
422
 
        
 
422
 
423
423
#ifdef SWORD_MULTIVERSE
424
424
        return (vkey.getChapterMax());
425
425
#else
432
432
 
433
433
unsigned int BackEnd::key_verse_count(const char *key)
434
434
{
435
 
        VerseKey vkey;  
 
435
        VerseKey vkey;
436
436
        vkey.AutoNormalize(1);
437
437
        vkey = key;
438
 
        
 
438
 
439
439
#ifdef SWORD_MULTIVERSE
440
440
        return (vkey.getVerseMax());
441
441
#else
442
442
        char testament = vkey.Testament() ;
443
443
        char book = vkey.Book();
444
 
        int chapter = vkey.Chapter();   
 
444
        int chapter = vkey.Chapter();
445
445
        return (vkey.books[testament-1][book-1].versemax[chapter-1]);
446
446
#endif
447
447
}
448
448
 
449
449
 
450
450
char *BackEnd::get_module_key()
451
 
 
451
{
452
452
        (const char *) *display_mod;
453
 
        
 
453
 
454
454
        return strdup((char*)display_mod->KeyText());
455
455
}
456
456
 
463
463
void BackEnd::save_note_entry(const char * module, const char * key, const char * entry)
464
464
{
465
465
        display_mod = main_mgr->Modules[module];
466
 
        
467
 
        if (display_mod) {              
 
466
 
 
467
        if (display_mod) {
468
468
                display_mod->setKey(key);
469
469
                display_mod->KeyText(); /* snap to entry */
470
470
                display_mod->setEntry((const char *) entry);
484
484
const char *BackEnd::module_get_language(const char *module_name)
485
485
{
486
486
        ModMap::iterator it;
487
 
        //-- iterate through the modules until we find modName  
 
487
        //-- iterate through the modules until we find modName
488
488
        it = main_mgr->Modules.find(module_name);
489
489
        //-- if we find the module
490
490
        if (it != main_mgr->Modules.end())
508
508
int BackEnd::module_type(const char *mod_name)
509
509
{
510
510
        ModMap::iterator it;
511
 
        if((!mod_name) || (strlen(mod_name) < 2)) 
 
511
        if ((!mod_name) || (strlen(mod_name) < 2))
512
512
                return -1;
513
 
        //-- iterate through the modules until we find modName 
 
513
        //-- iterate through the modules until we find modName
514
514
        it = main_mgr->Modules.find(mod_name);
515
515
        //-- if we find the module
516
516
        if (it != main_mgr->Modules.end()) {
520
520
                }
521
521
 
522
522
                if (!strcmp((*it).second->Type(), COMM_MODS)) {
523
 
                        if (!strcmp((char *) (*it).second->getConfigEntry("ModDrv"), "RawFiles")) 
524
 
                                return PERCOM_TYPE;                     
 
523
                        if (!strcmp((char *) (*it).second->getConfigEntry("ModDrv"), "RawFiles"))
 
524
                                return PERCOM_TYPE;
525
525
                        return COMMENTARY_TYPE;
526
526
                }
527
527
 
530
530
                }
531
531
 
532
532
                if (!strcmp((*it).second->Type(), BOOK_MODS)) {
533
 
                        if ((*it).second->getConfigEntry("GSType") && 
534
 
                                !strcmp((char *) (*it).second->getConfigEntry("GSType"), "PrayerList")) 
 
533
                        if ((*it).second->getConfigEntry("GSType") &&
 
534
                                !strcmp((char *) (*it).second->getConfigEntry("GSType"), "PrayerList"))
535
535
                                return PRAYERLIST_TYPE;
536
536
                        return BOOK_TYPE;
537
537
                }
542
542
char *BackEnd::module_description(char *mod_name)
543
543
{
544
544
        ModMap::iterator it;
545
 
        
546
 
        if((!mod_name) || (strlen(mod_name) < 2)) 
 
545
 
 
546
        if ((!mod_name) || (strlen(mod_name) < 2))
547
547
                return NULL;
548
 
        //-- iterate through the modules until we find modName 
 
548
        //-- iterate through the modules until we find modName
549
549
        it = main_mgr->Modules.find(mod_name);
550
550
        //-- if we find the module
551
 
        if (it != main_mgr->Modules.end()) {    
 
551
        if (it != main_mgr->Modules.end()) {
552
552
                return (*it).second->Description();
553
553
        }
554
554
        return NULL;
555
555
}
556
 
 
 
556
 
557
557
char *BackEnd::module_name_from_description(char *description)
558
558
{
559
559
        ModMap::iterator it;
560
560
        char *retval = NULL;
561
 
         
562
 
        if(!description)
 
561
 
 
562
        if (!description)
563
563
                return NULL;
564
 
        
 
564
 
565
565
        for (it = main_mgr->Modules.begin();
566
566
             it != main_mgr->Modules.end(); it++) {
567
567
                  if (!strcmp((*it).second->Description(), description))
574
574
int BackEnd::get_key_testament(const char * key)
575
575
{
576
576
        sword::VerseKey ikey( key );
577
 
        return ikey.Testament();        
 
577
        return ikey.Testament();
578
578
}
579
579
 
580
580
int BackEnd::module_has_testament(const char * module_name,  int testament)
582
582
        ModMap::iterator it;
583
583
        int ot = 0;
584
584
        int nt = 0;
585
 
        
 
585
 
586
586
        it = main_mgr->Modules.find(module_name);
587
587
        if (it != main_mgr->Modules.end()) {
588
588
                SWModule *module = (*it).second;
595
595
                } else if (key.Testament() == 2) { //no OT
596
596
                        ot = 0;
597
597
                }
598
 
        
 
598
 
599
599
                *module = sword::BOTTOM;
600
600
                key = module->KeyText();
601
601
                if (key.Testament() == 1) { // only OT, no NT
621
621
        ModMap::iterator it;
622
622
        int ot = 0;
623
623
        int nt = 0;
624
 
        
 
624
 
625
625
        it = main_mgr->Modules.find(module_name);
626
626
        if (it != main_mgr->Modules.end()) {
627
627
                SWModule *module = (*it).second;
633
633
                        } else if (key.Testament() == 2) { //no OT
634
634
                                ot = 0;
635
635
                        }
636
 
        
 
636
 
637
637
                        *module = sword::BOTTOM;
638
638
                        key = module->KeyText();
639
639
                        if (key.Testament() == 1) { // only OT, no NT
643
643
                        }
644
644
                 module->setSkipConsecutiveLinks(false);
645
645
        }
646
 
        if(ot && nt)
 
646
        if (ot && nt)
647
647
                return 2;
648
 
        else if(!ot && nt)
 
648
        else if (!ot && nt)
649
649
                return 1;
650
 
        else if(ot && !nt)
 
650
        else if (ot && !nt)
651
651
                return 0;
652
652
        return -1;
653
653
}
655
655
char *BackEnd::get_entry_attribute(const char *level1, const char *level2, const char *level3)
656
656
{
657
657
        UTF8HTML u2html;
658
 
        display_mod->RenderText();                      
 
658
        display_mod->RenderText();
659
659
        SWBuf attribute2 = display_mod->getEntryAttributes()[level1][level2][level3].c_str();
660
 
        
 
660
 
661
661
        u2html.processText(attribute2);
662
 
        
663
 
        if (attribute2.length()) {  
 
662
 
 
663
        if (attribute2.length()) {
664
664
                return strdup(attribute2.c_str());
665
 
        }  
666
 
        return NULL;    
 
665
        }
 
666
        return NULL;
667
667
}
668
668
 
669
 
 
 
669
 
670
670
int BackEnd::set_module(const char *module_name)
671
671
{
672
672
        display_mod = main_mgr->Modules[module_name];
673
 
        if (display_mod) 
 
673
        if (display_mod)
674
674
                return 1;
675
 
        else 
 
675
        else
676
676
                return 0;
677
 
        
 
677
 
678
678
}
679
679
 
680
680
int BackEnd::set_module_key(const char *module_name, const char *key)
681
681
{
682
682
        display_mod = main_mgr->Modules[module_name];
683
 
        
 
683
 
684
684
        if (display_mod) {
685
685
                GS_message((f_message,878,"key",key));
686
686
                display_mod->setKey(key);
687
687
                return 1;
688
688
        }
689
 
        else 
 
689
        else
690
690
                return 0;
691
 
        
 
691
 
692
692
}
693
693
 
694
694
int BackEnd::set_key(const char *key)
695
695
{
696
 
        if(!key)
 
696
        if (!key)
697
697
                return 0;
698
698
        if (display_mod) {
699
699
                GS_message((f_message,758,"key",key));
701
701
                return 1;
702
702
        }
703
703
        return 0;
704
 
        
 
704
 
705
705
}
706
706
 
707
707
char *BackEnd::get_key_from_offset(unsigned long offset)
721
721
 
722
722
unsigned long BackEnd::treekey_set_key(char * key)
723
723
{
724
 
        if(tree_key) {
 
724
        if (tree_key) {
725
725
                TreeKeyIdx treenode = *tree_key;
726
726
                treenode.setText(key);
727
727
                display_mod->SetKey(treenode);
732
732
}
733
733
void BackEnd::set_treekey(unsigned long offset)
734
734
{
735
 
        if(tree_key)
 
735
        if (tree_key)
736
736
                delete tree_key;
737
737
        tree_key = (TreeKeyIdx *) display_mod->CreateKey();
738
738
        if (tree_key) {
751
751
        SWModule *mod;
752
752
        ModMap::iterator it;
753
753
        unsigned long retval = 0;
754
 
        //-- iterate through the modules until we find modName  
 
754
        //-- iterate through the modules until we find modName
755
755
        it = main_mgr->Modules.find(module_name);
756
756
        //-- if we find the module
757
 
        if (it != main_mgr->Modules.end()) {            
 
757
        if (it != main_mgr->Modules.end()) {
758
758
                mod = (*it).second;
759
759
                TreeKeyIdx *tree_key_idx = (TreeKeyIdx *) mod->CreateKey();
760
760
                tree_key_idx->setText(key);
768
768
 
769
769
 
770
770
unsigned long BackEnd::get_treekey_offset(void)
771
 
{       
772
 
        if (tree_key) 
 
771
{
 
772
        if (tree_key)
773
773
                return tree_key->getOffset();
774
774
        return 0;
775
775
}
776
776
 
777
777
 
778
778
int BackEnd::treekey_has_children(unsigned long offset)
779
 
{       
 
779
{
780
780
        if (tree_key) {
781
781
                tree_key->setOffset(offset);
782
782
                return tree_key->hasChildren();
806
806
 
807
807
 
808
808
char *BackEnd::treekey_get_local_name(unsigned long offset)
809
 
{       
 
809
{
810
810
        if (tree_key) {
811
811
                tree_key->setOffset(offset);
812
812
                //-- returned value must be freed by calling function
820
820
{
821
821
        if (tree_key) {
822
822
                tree_key->setOffset(offset);
823
 
                if(tree_key->nextSibling()) {
 
823
                if (tree_key->nextSibling()) {
824
824
                        return 1;
825
 
                }       
 
825
                }
826
826
        }
827
827
        return 0;
828
828
}
833
833
{
834
834
        if (tree_key) {
835
835
                tree_key->setOffset(offset);
836
 
                if(tree_key->previousSibling()) {
 
836
                if (tree_key->previousSibling()) {
837
837
                        return 1;
838
 
                }       
 
838
                }
839
839
        }
840
840
        return 0;
841
841
}
862
862
{
863
863
        GList *retlist = NULL;
864
864
        VerseKey key;
865
 
        ListKey vs;                                                   
866
 
        
867
 
        if(!list)
 
865
        ListKey vs;
 
866
 
 
867
        if (!list)
868
868
                return retlist;
869
869
        GS_message(("current_key=%s",current_key));
870
870
        key.setText(current_key);
883
883
        GList *retlist = NULL;
884
884
        const char *buf = NULL;
885
885
        VerseKey key;
886
 
        
 
886
 
887
887
        verses.ClearList();
888
888
        verses = key.ParseVerseList(list, key, true);
889
889
 
890
890
        buf = verses.getRangeText();
891
891
        retlist = g_list_append(retlist, g_strdup(buf));
892
 
    
 
892
 
893
893
        return retlist;
894
894
}
895
895
 
908
908
        // we solve the problem by copying the data while it's current.
909
909
        // it's ugly (returning a pointer to a static char []) but it works.
910
910
 
911
 
        static char retval[128];                                                  
912
 
        
913
 
        while(!results.Error()) {               
 
911
        static char retval[128];
 
912
 
 
913
        while (!results.Error()) {
914
914
                (void) g_strlcpy(retval, results.getText(), 126);
915
915
                results++;
916
916
                return retval;
917
917
        }
918
 
        return NULL;    
 
918
        return NULL;
919
919
}
920
920
 
921
921
int BackEnd::clear_scope(void)
922
922
{
923
 
        current_scope = 0;      
 
923
        current_scope = 0;
924
924
        return 1;
925
925
}
926
926
 
949
949
 
950
950
int BackEnd::do_module_index(char *module_name)
951
951
{
952
 
        
 
952
 
953
953
        search_mod = main_mgr->Modules[module_name];
954
954
        if (!search_mod)
955
955
                return -1;
956
956
        char progressunits = 70;
957
957
        if (!search_mod->hasSearchFramework())
958
958
                return 0;
959
 
        
 
959
 
960
960
        search_mod->deleteSearchFramework();
961
961
        search_mod->createSearchFramework(main_index_percent_update,
962
962
                                        (void *) &progressunits);
965
965
 
966
966
int BackEnd::do_module_delete_index(char *module_name)
967
967
{
968
 
        
 
968
 
969
969
        search_mod = main_mgr->Modules[module_name];
970
970
        if (!search_mod)
971
971
                return -1;
972
972
        if (!search_mod->hasSearchFramework())
973
973
                return 0;
974
 
        
 
974
 
975
975
        search_mod->deleteSearchFramework();
976
976
        return 1;
977
977
}
979
979
int BackEnd::check_for_optimal_search(char * module_name)
980
980
{
981
981
        search_mod = main_mgr->Modules[module_name];
982
 
        
 
982
 
983
983
        if (!search_mod)
984
984
                return -2;
985
985
        if (search_mod->hasSearchFramework() &&
986
986
            search_mod->isSearchOptimallySupported("God", -4, 0, 0))
987
 
                return -4; // ** indexed search - clucene ** 
 
987
                return -4; // ** indexed search - clucene **
988
988
        else
989
989
                return -2; // ** word search **
990
990
}
1006
1006
        if ((current_scope == &search_scope_list) &&
1007
1007
            (search_scope_list.Count() == 0))
1008
1008
                return 0;
1009
 
        
 
1009
 
1010
1010
        results = search_mod->search(search_string,
1011
1011
                                search_type,
1012
1012
                                search_params,
1026
1026
        if (search_mod)
1027
1027
                search_mod->terminateSearch = true;
1028
1028
}
1029
 
 
 
1029
 
1030
1030
char *BackEnd::get_conf_file_item(const char * file, const char * mod_name, const char * item)
1031
1031
{
1032
1032
        char *buf = NULL;
1034
1034
        conf_file.Load();
1035
1035
 
1036
1036
        buf = (char *) conf_file[mod_name][item].c_str();
1037
 
        if(strlen(buf))
 
1037
        if (strlen(buf))
1038
1038
                return strdup(buf);
1039
1039
        else
1040
1040
                return NULL;
1049
1049
        conf_file[mod_name][item] = value;
1050
1050
        conf_file.Save();
1051
1051
}
1052
 
 
 
1052
 
1053
1053
void BackEnd::save_module_key(char *mod_name, char *key)
1054
1054
{
1055
1055
        SectionMap::iterator section;