|
@@ -46,13 +46,13 @@ NKRecnik::NKRecnik(QWidget *parent, const char *name) : nkrGUI(parent, name)
|
|
|
|
|
|
// Loading default dictionary
|
|
|
Dict = new McDict("dict.dat", KDE_STYLE);
|
|
|
- kdeDict = new McDict("kde-dict.dat", KDE_STYLE);
|
|
|
+// kdeDict = new McDict("kde-dict.dat", KDE_STYLE);
|
|
|
logger->append("Default dictionary loaded");
|
|
|
|
|
|
// Loading user dictionary
|
|
|
- QString updictfile = config->progDir() + "/updictionary.dat";
|
|
|
- updateDict = new McDict(updictfile, PLAIN_STYLE);
|
|
|
- logger->append("User dictionary loaded, its: " + updictfile);
|
|
|
+ QString updictfile = config->progDir() + "/updictionary.dat";
|
|
|
+ updateDict = new McDict(updictfile, PLAIN_STYLE);
|
|
|
+ logger->append("User dictionary loaded, its: " + updictfile);
|
|
|
|
|
|
// Loading additional dictionary.
|
|
|
if (config->add_dict != "")
|
|
@@ -74,7 +74,7 @@ NKRecnik::NKRecnik(QWidget *parent, const char *name) : nkrGUI(parent, name)
|
|
|
|
|
|
// Disabling sorting
|
|
|
Dict->setSort(false);
|
|
|
- updateDict->setSort(false);
|
|
|
+// updateDict->setSort(false);
|
|
|
|
|
|
// Setting some options from config file (others in constructor)
|
|
|
logger->append("Setting configuration");
|
|
@@ -117,9 +117,9 @@ NKRecnik::~NKRecnik()
|
|
|
{
|
|
|
delete config;
|
|
|
delete Dict;
|
|
|
- delete kdeDict;
|
|
|
- delete updateDict;
|
|
|
- delete additionalDict;
|
|
|
+// delete kdeDict;
|
|
|
+// delete updateDict;
|
|
|
+// delete additionalDict;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -130,7 +130,6 @@ void NKRecnik::retPressed()
|
|
|
{
|
|
|
//QTime t;
|
|
|
//t.start();
|
|
|
-
|
|
|
tabs->setCurrentPage(0);
|
|
|
numAllWords = 0;
|
|
|
for (int i=0; i < 100; i++)
|
|
@@ -146,8 +145,8 @@ void NKRecnik::retPressed()
|
|
|
logger->append("Looking for " + queryPhrase + ". Found:");
|
|
|
int upNumWords=0, numWords=0, adNumWords=0;
|
|
|
|
|
|
- if (!inKdeMode)
|
|
|
- {
|
|
|
+// if (!inKdeMode)
|
|
|
+// {
|
|
|
numWords = Dict->find(queryPhrase);
|
|
|
if (updateDict->doesExist())
|
|
|
upNumWords = updateDict->find(queryPhrase);
|
|
@@ -173,10 +172,10 @@ void NKRecnik::retPressed()
|
|
|
allWords[numAllWords][1] = additionalDict->getWord(i, 1);
|
|
|
++numAllWords;
|
|
|
}
|
|
|
- }
|
|
|
+/* }
|
|
|
else // So, we're in KDE mode.
|
|
|
- {
|
|
|
- numWords = kdeDict->find(queryPhrase);
|
|
|
+ {
|
|
|
+ numWords = kdeDict->find(queryPhrase);
|
|
|
for (int i = 0; i < numWords; i++)
|
|
|
{
|
|
|
allWords[numAllWords][0] = kdeDict->getWord(i, 0);
|
|
@@ -184,7 +183,7 @@ void NKRecnik::retPressed()
|
|
|
++numAllWords;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+*/
|
|
|
logger->append(tr2i18n("Found ").setNum(numAllWords));
|
|
|
|
|
|
if (numAllWords == 0)
|
|
@@ -195,7 +194,7 @@ void NKRecnik::retPressed()
|
|
|
else
|
|
|
{
|
|
|
// sort them
|
|
|
- sortWords(numAllWords);
|
|
|
+// sortWords(numAllWords);
|
|
|
// show them
|
|
|
if (numAllWords > 100) numAllWords = 100; //limitations
|
|
|
for (int i = 0; i < numAllWords; i++)
|
|
@@ -225,7 +224,7 @@ void NKRecnik::rbEnToogled(int state)
|
|
|
table->hideRow(i);
|
|
|
}
|
|
|
Dict->dictChange(EN2SR);
|
|
|
- updateDict->dictChange(EN2SR);
|
|
|
+// updateDict->dictChange(EN2SR);
|
|
|
if (addDictLoaded) additionalDict->dictChange(EN2SR);
|
|
|
table->horizontalHeader()->setLabel(0, tr2i18n("English"));
|
|
|
table->horizontalHeader()->setLabel(1, tr2i18n("Serbian"));
|
|
@@ -245,7 +244,7 @@ void NKRecnik::rbSrToogled(int state)
|
|
|
table->hideRow(i);
|
|
|
}
|
|
|
Dict->dictChange(SR2EN);
|
|
|
- updateDict->dictChange(SR2EN);
|
|
|
+// updateDict->dictChange(SR2EN);
|
|
|
if (addDictLoaded) additionalDict->dictChange(SR2EN);
|
|
|
table->horizontalHeader()->setLabel(0, tr2i18n("Serbian"));
|
|
|
table->horizontalHeader()->setLabel(1, tr2i18n("English"));
|
|
@@ -307,8 +306,8 @@ void NKRecnik::inverse()
|
|
|
rbSr->setChecked(false);
|
|
|
rbEn->setChecked(true);
|
|
|
Dict->dictChange(EN2SR);
|
|
|
- updateDict->dictChange(EN2SR);
|
|
|
- if (addDictLoaded) additionalDict->dictChange(EN2SR);
|
|
|
+// updateDict->dictChange(EN2SR);
|
|
|
+// if (addDictLoaded) additionalDict->dictChange(EN2SR);
|
|
|
table->horizontalHeader()->setLabel(0, tr2i18n("English"));
|
|
|
table->horizontalHeader()->setLabel(1, tr2i18n("Serbian"));
|
|
|
}
|
|
@@ -317,8 +316,8 @@ void NKRecnik::inverse()
|
|
|
rbEn->setChecked(false);
|
|
|
rbSr->setChecked(true);
|
|
|
Dict->dictChange(SR2EN);
|
|
|
- updateDict->dictChange(SR2EN);
|
|
|
- if (addDictLoaded) additionalDict->dictChange(SR2EN);
|
|
|
+// updateDict->dictChange(SR2EN);
|
|
|
+// if (addDictLoaded) additionalDict->dictChange(SR2EN);
|
|
|
table->horizontalHeader()->setLabel(0, tr2i18n("Serbian"));
|
|
|
table->horizontalHeader()->setLabel(1, tr2i18n("English"));
|
|
|
}
|
|
@@ -395,8 +394,8 @@ void NKRecnik::applySetClicked()
|
|
|
table->setColumnWidth(1, (tabSize.width() / 2) - widthRight->value());
|
|
|
|
|
|
// Load Additional dictionary
|
|
|
- if (addDictLoaded) delete additionalDict;
|
|
|
- if (lineAddDict->text() != "")
|
|
|
+/* if (addDictLoaded) delete additionalDict;
|
|
|
+ if (lineAddDict->text() != "")
|
|
|
{
|
|
|
additionalDict = new McDict(lineAddDict->text(), PLAIN_STYLE);
|
|
|
additionalDict->setSort(false);
|
|
@@ -404,6 +403,7 @@ void NKRecnik::applySetClicked()
|
|
|
}
|
|
|
else
|
|
|
addDictLoaded = false;
|
|
|
+*/
|
|
|
}
|
|
|
|
|
|
|
|
@@ -426,7 +426,7 @@ void NKRecnik::saveSetClicked()
|
|
|
}
|
|
|
config->clip_format = lineFormat->text();
|
|
|
config->kde_mode = 0;
|
|
|
- config->add_dict = lineAddDict->text();
|
|
|
+// config->add_dict = lineAddDict->text();
|
|
|
|
|
|
config->saveSettings();
|
|
|
}
|
|
@@ -444,16 +444,16 @@ void NKRecnik::helpSetClicked()
|
|
|
|
|
|
void NKRecnik::browseSetClicked()
|
|
|
{
|
|
|
- QString addDictFile;
|
|
|
+ /*QString addDictFile;
|
|
|
addDictFile = KFileDialog::getOpenFileName(config->homeDir(), "*.dat | Dictionary file (*.dat)\n", this, "Open Dictionary");
|
|
|
logger->append("Opened file: " + addDictFile);
|
|
|
- lineAddDict->setText(addDictFile);
|
|
|
+ lineAddDict->setText(addDictFile);*/
|
|
|
}
|
|
|
|
|
|
|
|
|
void NKRecnik::updateClicked()
|
|
|
{
|
|
|
- if(!updateDict->writeEntry(upEnLine->text(), upSrLine->text()))
|
|
|
+ /*if(!updateDict->writeEntry(upEnLine->text(), upSrLine->text()))
|
|
|
QMessageBox::warning(this, tr2i18n("Failed!"), tr2i18n("For some reason, updating was not performed!"),0,0,1);
|
|
|
else
|
|
|
{
|
|
@@ -461,7 +461,7 @@ void NKRecnik::updateClicked()
|
|
|
upSrLine->setText("");
|
|
|
upEnLine->setText("");
|
|
|
upEnLine->setFocus();
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
|
|
|
|