Switch to unified view

a/src/qtgui/confgui/confguiindex.cpp b/src/qtgui/confgui/confguiindex.cpp
...
...
33
33
34
#include "confgui.h"
34
#include "confgui.h"
35
#include "recoll.h"
35
#include "recoll.h"
36
#include "confguiindex.h"
36
#include "confguiindex.h"
37
#include "smallut.h"
37
#include "smallut.h"
38
#include "debuglog.h"
38
#include "log.h"
39
#include "rcldb.h"
39
#include "rcldb.h"
40
#include "conflinkrcl.h"
40
#include "conflinkrcl.h"
41
#include "execmd.h"
41
#include "execmd.h"
42
#include "rclconfig.h"
42
#include "rclconfig.h"
43
43
...
...
66
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(rejectChanges()));
66
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(rejectChanges()));
67
}
67
}
68
68
69
void ConfIndexW::acceptChanges()
69
void ConfIndexW::acceptChanges()
70
{
70
{
71
    LOGDEB(("ConfIndexW::acceptChanges()\n"));
71
    LOGDEB("ConfIndexW::acceptChanges()\n" );
72
    if (!m_conf) {
72
    if (!m_conf) {
73
    LOGERR(("ConfIndexW::acceptChanges: no config\n"));
73
    LOGERR("ConfIndexW::acceptChanges: no config\n" );
74
    return;
74
    return;
75
    }
75
    }
76
    // Let the changes to disk
76
    // Let the changes to disk
77
    if (!m_conf->holdWrites(false)) {
77
    if (!m_conf->holdWrites(false)) {
78
    QMessageBox::critical(0, "Recoll",  
78
    QMessageBox::critical(0, "Recoll",  
...
...
86
    hide();
86
    hide();
87
}
87
}
88
88
89
void ConfIndexW::rejectChanges()
89
void ConfIndexW::rejectChanges()
90
{
90
{
91
    LOGDEB(("ConfIndexW::rejectChanges()\n"));
91
    LOGDEB("ConfIndexW::rejectChanges()\n" );
92
    // Discard local changes.
92
    // Discard local changes.
93
    delete m_conf;
93
    delete m_conf;
94
    m_conf = 0;
94
    m_conf = 0;
95
    hide();
95
    hide();
96
}
96
}
...
...
475
    ExecCmd ex;
475
    ExecCmd ex;
476
    string icout;
476
    string icout;
477
    string cmd = "iconv";
477
    string cmd = "iconv";
478
    int status = ex.doexec(cmd, args, 0, &icout);
478
    int status = ex.doexec(cmd, args, 0, &icout);
479
    if (status) {
479
    if (status) {
480
    LOGERR(("Can't get list of charsets from 'iconv -l'"));
480
    LOGERR("Can't get list of charsets from 'iconv -l'" );
481
    }
481
    }
482
    icout = neutchars(icout, ",");
482
    icout = neutchars(icout, ",");
483
    list<string> ccsets;
483
    list<string> ccsets;
484
    stringToStrings(icout, ccsets);
484
    stringToStrings(icout, ccsets);
485
    QStringList charsets;
485
    QStringList charsets;
...
...
577
    }
577
    }
578
}
578
}
579
579
580
void ConfSubPanelW::subDirChanged(QListWidgetItem *current, QListWidgetItem *)
580
void ConfSubPanelW::subDirChanged(QListWidgetItem *current, QListWidgetItem *)
581
{
581
{
582
    LOGDEB(("ConfSubPanelW::subDirChanged\n"));
582
    LOGDEB("ConfSubPanelW::subDirChanged\n" );
583
    
583
    
584
    if (current == 0 || current->text() == "") {
584
    if (current == 0 || current->text() == "") {
585
    m_sk = "";
585
    m_sk = "";
586
    m_groupbox->setTitle(tr("Global"));
586
    m_groupbox->setTitle(tr("Global"));
587
    } else {
587
    } else {
588
    m_sk = (const char *) current->text().toUtf8();
588
    m_sk = (const char *) current->text().toUtf8();
589
    m_groupbox->setTitle(current->text());
589
    m_groupbox->setTitle(current->text());
590
    }
590
    }
591
    LOGDEB(("ConfSubPanelW::subDirChanged: now [%s]\n", m_sk.c_str()));
591
    LOGDEB("ConfSubPanelW::subDirChanged: now ["  << (m_sk) << "]\n" );
592
    reloadAll();
592
    reloadAll();
593
}
593
}
594
594
595
void ConfSubPanelW::subDirDeleted(QString sbd)
595
void ConfSubPanelW::subDirDeleted(QString sbd)
596
{
596
{
597
    LOGDEB(("ConfSubPanelW::subDirDeleted(%s)\n", (const char *)sbd.toUtf8()));
597
    LOGDEB("ConfSubPanelW::subDirDeleted("  << ((const char *)sbd.toUtf8()) << ")\n" );
598
    if (sbd == "") {
598
    if (sbd == "") {
599
    // Can't do this, have to reinsert it
599
    // Can't do this, have to reinsert it
600
    QTimer::singleShot(0, this, SLOT(restoreEmpty()));
600
    QTimer::singleShot(0, this, SLOT(restoreEmpty()));
601
    return;
601
    return;
602
    }
602
    }
...
...
604
    m_config->eraseKey((const char *)sbd.toUtf8());
604
    m_config->eraseKey((const char *)sbd.toUtf8());
605
}
605
}
606
606
607
void ConfSubPanelW::restoreEmpty()
607
void ConfSubPanelW::restoreEmpty()
608
{
608
{
609
    LOGDEB(("ConfSubPanelW::restoreEmpty()\n"));
609
    LOGDEB("ConfSubPanelW::restoreEmpty()\n" );
610
    m_subdirs->getListBox()->insertItem(0, "");
610
    m_subdirs->getListBox()->insertItem(0, "");
611
}
611
}
612
612
613
} // Namespace confgui
613
} // Namespace confgui
614