-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
638 lines (529 loc) · 21.8 KB
/
Copy pathmainwindow.cpp
File metadata and controls
638 lines (529 loc) · 21.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QFile>
#include<QDir>
#include<QByteArray>
#include "quazip/quazip.h"
#include "quazip/quazipfile.h"
#include <QXmlStreamReader>
#include <QtWidgets>
//#include <QtXmlPatterns/QXmlQuery>
#include <QElapsedTimer>
#include <QMessageBox>
#include <QtConcurrent/QtConcurrent>
#include <QStringBuilder>
#include <QRegExp>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));
QDir Dir;
if(!Dir.exists(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).constFirst()))
Dir.mkdir(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).constFirst());
m_sDBFile = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).constFirst() + "/smplib.db";
m_sSettings = new QSettings(QSettings::NativeFormat, QSettings::UserScope, "simplelib", "simplelib");
m_DbEngine = m_sSettings->value("DbEngine", 0).toInt();
connect(ui->lineAuthorFind, &QLineEdit::returnPressed, this, &MainWindow::OnLineAuthorFindReturnPressed);
connect(ui->listAuthor, &QListWidget::itemSelectionChanged, this, &MainWindow::OnListAuthorItemSelectionChanged);
connect(ui->tableBook, &QTableWidget::customContextMenuRequested, this, &MainWindow::OnTableWidgetCustomContextMenuRequested);
//connect menu
connect(ui->actionExit, &QAction::triggered, this, &MainWindow::OnMenuActionExit);
connect(ui->actionPreferences, &QAction::triggered, this, &MainWindow::OnMenuActionPreferences);
//connect(ui->actionAbout, &QAction::triggered, this, &MainWindow::OnMenuActionAbout);
connect(ui->actionUpdateDB, &QAction::triggered, this, &MainWindow::OnMenuActionUpdateDB);
connect(ui->actionRescanDB, &QAction::triggered, this, &MainWindow::OnMenuActionRescanDB);
connect(ui->actionClearDB, &QAction::triggered, this, &MainWindow::OnMenuActionClearDB);
m_DlgSettings = new SettingsDialog(this);
this->setWindowState(Qt::WindowMaximized);
}
MainWindow::~MainWindow()
{
delete ui;
delete m_sSettings;
if(m_tmpFile){delete m_tmpFile; m_tmpFile = nullptr;}
}
void MainWindow::resizeEvent(QResizeEvent* event)
{
QMainWindow::resizeEvent(event);
// Your code here.
QRect r = ui->gridLayoutWidget->geometry();
r.setBottom(event->size().height() - r.top() - 20);
r.setRight(event->size().width() - r.left());
ui->gridLayoutWidget->setGeometry(r);
}
QString MainWindow::timeConversion(int msecs)
{
QString formattedTime;
int hours = msecs/(1000*60*60);
int minutes = (msecs-(hours*1000*60*60))/(1000*60);
int seconds = (msecs-(minutes*1000*60)-(hours*1000*60*60))/1000;
int milliseconds = msecs-(seconds*1000)-(minutes*1000*60)-(hours*1000*60*60);
formattedTime.append(QString("%1").arg(hours, 2, 10, QLatin1Char('0')) + ":" +
QString( "%1" ).arg(minutes, 2, 10, QLatin1Char('0')) + ":" +
QString( "%1" ).arg(seconds, 2, 10, QLatin1Char('0')) + ":" +
QString( "%1" ).arg(milliseconds, 3, 10, QLatin1Char('0')));
return formattedTime;
}
QThreadPool *thread_pool = QThreadPool::globalInstance();
int zipcountpassed = 0;
static void aBigZipRun(QFileInfo fi, MainWindow* Parent)
{
Parent->ParseBigZipFunc(fi,Parent);
}
int time_parse = 0;
int time_author = 0;
int time_book = 0;
void MainWindow::ParseBigZipFunc(QFileInfo fi, MainWindow*/* Parent*/)
{
QFile infile(fi.absoluteFilePath());
infile.open(QIODevice::ReadOnly);
QuaZip BigZip(&infile);
BigZip.open(QuaZip::mdUnzip);
QList<QuaZipFileInfo> ZipFI = BigZip.getFileInfoList();
auto timer_parse = std::make_unique<QElapsedTimer>();
auto timer_author = std::make_unique<QElapsedTimer>();
auto timer_book = std::make_unique<QElapsedTimer>();
int books_processed = 0;
//auto db = std::make_unique<SmpLibDatabase>(m_sDBFile, m_DbEngine);
SmpLibDatabase* db = SmpLibDatabase::instance(m_sDBFile, m_DbEngine);
//add filepath into the database
//filepath is not yet in the database?
auto file_checksum = QString(fileChecksum(fi.absoluteFilePath(), QCryptographicHash::Md5));
SmpLibDatabase::LibFileStruct LibFile = {0, NULL,fi.fileName(), fi.absoluteDir().path(), file_checksum};
auto fileexist = db->IsLibFileExist(LibFile);
if(fileexist == SmpLibDatabase::LIBFILERESULT::EXIST)
{
return;
}
if(fileexist == SmpLibDatabase::LIBFILERESULT::WRONG_HASH)
{
auto id = db->GetLibFileIdByPathName(LibFile);
db->RemoveBrokenEntries(id);
}
LibFile.id = db->AddLibFile(LibFile); // lib file added without hash. hash will be written when file will be processed;
foreach(QuaZipFileInfo fi2, ZipFI)
{
if(!fi2.name.endsWith("fb2", Qt::CaseInsensitive)) continue;
timer_parse->start();
BigZip.setCurrentFile(fi2.name);
QuaZipFile file(&BigZip);
file.open(QIODevice::ReadOnly);
QByteArray BookData = file.readAll();
file.close();
QXmlStreamReader reader(BookData);
QList<QString> first_name;
QList<QString> last_name;
QString book_title("");
QString genre("");
QString sequence_name("");
QString sequence_number = "";
bool bAuthorBlock = false;
while (!reader.atEnd())
{
QXmlStreamReader::TokenType token = reader.readNext();
/* If token is just StartDocument, we'll go to next.*/
if(token == QXmlStreamReader::StartDocument)
{
continue;
}
if (reader.isStartElement() && reader.name() == QString("author")) bAuthorBlock = true;
if (reader.isEndElement() && reader.name() == QString("author")) bAuthorBlock = false;
if (reader.isStartElement() && reader.name() == QString("first-name") && bAuthorBlock)
{
first_name.append(reader.readElementText().trimmed());
}
else if (reader.isStartElement() && reader.name() == QString("last-name") && bAuthorBlock)
{
last_name.append(reader.readElementText().trimmed());
}
else if (reader.isStartElement() && reader.name() == QString("book-title") && book_title.isEmpty())
{
book_title = reader.readElementText();
}
else if (reader.isStartElement() && reader.name() == QString("genre"))
{
genre = reader.readElementText();
}
else if (reader.isStartElement() && reader.name() == QString("sequence"))
{
auto attrs = reader.attributes();
if(attrs.hasAttribute(QLatin1String("name")))
sequence_name = attrs.value(QLatin1String("name")).toString();
if(attrs.hasAttribute(QLatin1String("number")))
sequence_number = attrs.value(QLatin1String("number")).toString();
}
else if(reader.isEndElement() && reader.name() == QString("title-info"))
break;
else
continue;
if (reader.hasError()) {
}
}
time_parse += timer_parse->elapsed();
//add author
QList<SmpLibDatabase::AuthorStruct> Authors;
for(int i=0;i<last_name.size();i++)
{
Authors.append({0,(first_name.size()>i)?first_name[i]:"",last_name[i], ""});
}
if(Authors.length() == 0)//no author
Authors.append({0,"","Без автора", ""});
//because more than 2 artists is unnatural
QList<int> author_id;
for(const auto &Author: Authors)
{
if(!db->IsAuthorExist(Author))
{
db->AddAuthor(Author);
}
author_id.append(db->GetAuthorIdByName(Author));
}
//add book to the database
//book is not in the database yet?
timer_book->start();
//add book
QString authorlist = ",";
for(const auto &Author: author_id) authorlist += QString::number(Author) + ",";
if(!db->IsBookExist(authorlist, book_title))
{
timer_author->start();
SmpLibDatabase::BookStruct Book;
Book.authors = authorlist;
Book.book_title = book_title;
Book.genre = genre;
Book.sequence_name = sequence_name;
Book.sequence_number = sequence_number;
Book.libfile_id = LibFile.id;
Book.name_in_archive = fi2.name;
Book.book_size = fi2.uncompressedSize;
db->AddBook(Book);
time_author += timer_author->elapsed();
}
time_book += timer_book->elapsed();
books_processed++;
QString stime_parse = timeConversion(time_parse);
QString stime_author = timeConversion(time_author);
QString stime_book = timeConversion(time_book);
QString stime_book2 = timeConversion(time_book);
}
db->UpdateLibFileHash(LibFile); //set hash after processing
}
void MainWindow::fillAuthorList(QString qsFilter)
{
QApplication::setOverrideCursor(Qt::WaitCursor);
QApplication::processEvents();
ui->listAuthor->clear();
SmpLibDatabase* db = SmpLibDatabase::instance(m_sDBFile, m_DbEngine);
auto AuthorList = db->GetAuthorList(qsFilter);
foreach (SmpLibDatabase::AuthorStruct Author, *AuthorList)
{
QString sAuthorLine;
if(Author.last_name != "" && Author.first_name != "")
sAuthorLine = Author.last_name + ", " + Author.first_name;
else if(Author.last_name == "")
sAuthorLine = Author.first_name;
else
sAuthorLine = Author.last_name;
QListWidgetItem* item = new QListWidgetItem(sAuthorLine);
item->setData(1,Author.id);
ui->listAuthor->addItem(item);
}
//delete &AuthorList;
QApplication::restoreOverrideCursor();
}
namespace BookTableColumns
{
enum
{
BookName = 0,
Serie = 1,
Size = 2,
BookId = 3
};
static QStringList Labels = QStringList()<<QString("Название книги")<<QString("Серия")<<QString("Размер")<<QString("");
}
void MainWindow::fillBookList(QString qsAuthor, QString qsFilter)
{
QApplication::setOverrideCursor(Qt::WaitCursor);
QApplication::processEvents();
ui->tableBook->clear();
ui->tableBook->setRowCount(0);
ui->tableBook->setSortingEnabled(false);
if(ui->tableBook->columnCount() != 4)
{
ui->tableBook->insertColumn(BookTableColumns::BookName);
ui->tableBook->setColumnWidth(BookTableColumns::BookName,450);
ui->tableBook->insertColumn(BookTableColumns::Serie);
ui->tableBook->setColumnWidth(BookTableColumns::Serie,250);
ui->tableBook->insertColumn(BookTableColumns::Size);
ui->tableBook->setColumnWidth(BookTableColumns::Size,100);
ui->tableBook->insertColumn(BookTableColumns::BookId);
ui->tableBook->setColumnWidth(BookTableColumns::BookId,0);
ui->tableBook->horizontalHeader()->setStretchLastSection(true);
ui->tableBook->setHorizontalHeaderLabels( BookTableColumns::Labels);
}
SmpLibDatabase* db = SmpLibDatabase::instance(m_sDBFile, m_DbEngine);
auto BookList = db->GetBookList(qsFilter, qsAuthor);
foreach (SmpLibDatabase::BookStruct Book, *BookList)
{
QString book_id = QString::number(Book.id);
QString book_title = Book.book_title;
QString sequence_name = Book.sequence_name;
QString sequence_number = Book.sequence_number;
int book_size = Book.book_size;
QTableWidgetItem* item = new QTableWidgetItem();
item->setText(book_title);
item->setFlags(item->flags() ^ Qt::ItemIsEditable);
item->data(Qt::CheckStateRole);
item->setCheckState(Qt::Unchecked);
ui->tableBook->insertRow(0);
ui->tableBook->setItem(0, BookTableColumns::BookName, item);
item = new QTableWidgetItem();
if(sequence_number != "" && sequence_number != "0")
item->setText(sequence_name + " " + sequence_number);
else
item->setText(sequence_name);
ui->tableBook->setItem(0, BookTableColumns::Serie, item);
item = new QTableWidgetItem();
item->setText(QString::number(book_size/1024) + "Kb");
ui->tableBook->setItem(0, BookTableColumns::Size, item);
item = new QTableWidgetItem();
item->setData(Qt::UserRole, book_id);
ui->tableBook->setItem(0, BookTableColumns::BookId, item);
}
ui->tableBook->sortByColumn(0, Qt::SortOrder::AscendingOrder);
ui->tableBook->sortByColumn(1, Qt::SortOrder::AscendingOrder);
ui->tableBook->setSortingEnabled(true);
QApplication::restoreOverrideCursor();
}
void MainWindow::TryFillAuthorList()
{
auto db = SmpLibDatabase::instance(m_sDBFile, m_DbEngine);
if(!db)
{
QMessageBox msg(this);
QMessageBox::warning(this, "Error", "Cannot open database!");
return;
}
fillAuthorList();
}
void MainWindow::show()
{
this->setVisible(true);
QTimer::singleShot(50, this, SLOT(TryFillAuthorList()));
}
void MainWindow::OnListAuthorItemSelectionChanged()
{
QList<QListWidgetItem*> List = ui->listAuthor->selectedItems();
if(List.count() > 0)
{
QListWidgetItem* item = List[0];
QString author_id = item->data(1).toString();
fillBookList(author_id);
}
}
void MainWindow::GetBookFromLib(int book_id, QByteArray& BookData,
std::unique_ptr<SmpLibDatabase::BookStruct>& Book,
std::unique_ptr<SmpLibDatabase::LibFileStruct>& LibFile)
{
SmpLibDatabase* db = SmpLibDatabase::instance(m_sDBFile, m_DbEngine);
Book = db->GetBook(book_id);
if(Book != nullptr)
{
LibFile = db->GetLibFile(Book->libfile_id);
if (LibFile != nullptr)
{
QString filename = Book->name_in_archive;
QString archname = LibFile->filename;
QString path = m_sSettings->value("LibPath").toString();
QFile infile(path + "/" + archname);
infile.open(QIODevice::ReadOnly);
QuaZip BigZip(&infile);
BigZip.open(QuaZip::mdUnzip);
BigZip.setCurrentFile(filename);
QuaZipFile file(&BigZip);
file.open(QIODevice::ReadOnly);
BookData = file.readAll();
file.close();
BigZip.close();
}
}
}
void MainWindow::OnBookGridRowOpenBook()
{
auto currow = ui->tableBook->currentItem()->row();
int book_id = ui->tableBook->item(currow, BookTableColumns::BookId)->data(Qt::UserRole).toInt();
QByteArray BookData;
std::unique_ptr<SmpLibDatabase::BookStruct> Book = nullptr;
std::unique_ptr<SmpLibDatabase::LibFileStruct> LibFile = nullptr;
GetBookFromLib(book_id, BookData, Book, LibFile);
if(BookData.size() > 0)
{
QString filename = Book->name_in_archive;
//QString archname = LibFile->filename;
//save to temp file
if(m_tmpFile != nullptr ){delete m_tmpFile; m_tmpFile = nullptr;}
QTemporaryFile tmpFile;
QString filename2 = "";
QString filename3 = filename;
filename2 = filename.replace( QRegularExpression("[^a-zA-Z0-9 _-().{}+=<>#$%&*]"),filename2);
if(filename3 != filename)
{//set alternate filename if name is broken
tmpFile.setFileTemplate(QDir::tempPath() + "/XXXXXX_" + Book->sequence_name.trimmed() + "_" + Book->sequence_number.trimmed() + "_" + Book->book_title + "_" + ".fb2");
}
else
tmpFile.setFileTemplate(QDir::tempPath() + "/XXXXXX_" + filename3);
tmpFile.open();
tmpFile.close();
m_tmpFile = new QFile(tmpFile.fileName());
tmpFile.remove();
if (m_tmpFile->open(QIODevice::WriteOnly))
{
m_tmpFile->write(BookData);
}
m_tmpFile->close();
QDesktopServices::openUrl(QUrl::fromLocalFile(m_tmpFile->fileName()));
auto ret = QtConcurrent::run([&](QString filename){
QThread::sleep(5);
QFile::remove(filename);
}, m_tmpFile->fileName());
}
}
void MainWindow::OnBookGridRowExportSelection()
{
static auto FileNameRegExp = QRegularExpression("[^a-zA-Z0-9 _-().{}+=<>#$:%&*]");
QItemSelectionModel *select = ui->tableBook->selectionModel();
for(const auto &li: select->selectedRows(BookTableColumns::BookId))
{
int book_id = 0;
book_id = li.data(Qt::UserRole).toInt();
QByteArray BookData;
std::unique_ptr<SmpLibDatabase::BookStruct> Book = nullptr;
std::unique_ptr<SmpLibDatabase::LibFileStruct> LibFile = nullptr;
GetBookFromLib(book_id, BookData, Book, LibFile);
auto db = SmpLibDatabase::instance(m_sDBFile, m_DbEngine);
auto author = db->GetAuthorById(Book->authors.split(',', Qt::SplitBehaviorFlags::SkipEmptyParts)[0].toInt());
if(BookData.size() > 0)
{
QString filename = Book->name_in_archive;
//QString archname = LibFile->filename;
//save to temp file
QString sFile;
QString filename2 = "";
//QString filename3 = filename;
filename2 = filename.replace( FileNameRegExp, filename2);
/*if(filename3 != filename)
{//set alternate filename if name is broken
sFile = QString(m_sSettings->value("ExportPath").toString() + "/" + Book.sequence_name.trimmed() + "_" + Book.sequence_number.trimmed() + "_" + Book.book_title + "_" + ".fb2");
}
else
sFile = m_sSettings->value("ExportPath").toString() + "/" + filename3;
*/
sFile = QString(m_sSettings->value("ExportPath").toString()) + "/";
QStringList nameParts {
(author->last_name.trimmed() + " " + author->first_name.trimmed()).trimmed(),
Book->sequence_name.trimmed(),
Book->sequence_number.trimmed(),
Book->book_title.trimmed()};
for(const auto& part : nameParts)
{
if(part != "")
{
sFile += part;
sFile += "_";
}
}
sFile = sFile.left(sFile.length() - 1);
QFile tmpFile(sFile + ".fb2");
if (tmpFile.open(QIODevice::WriteOnly))
{
tmpFile.write(BookData);
tmpFile.close();
}
}
}
}
void MainWindow::OnTableWidgetCustomContextMenuRequested(const QPoint &pos)
{
auto menu = new QMenu();
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->addAction(tr("Открыть книгу"), this, SLOT(OnBookGridRowOpenBook()));
menu->addAction(tr("Экспорт"), this, SLOT(OnBookGridRowExportSelection()));
menu->popup(ui->tableBook->viewport()->mapToGlobal(pos));
}
void MainWindow::OnMenuActionPreferences()
{
m_DlgSettings->setModal(true);
m_DlgSettings->exec();
if(static_cast<QDialog::DialogCode>(m_DlgSettings->result()) == QDialog::Accepted)
{
TryFillAuthorList();
}
}
void MainWindow::OnMenuActionExit()
{
this->close();
}
void MainWindow::UpdateDB(bool /*bRescan*/)
{
QApplication::setOverrideCursor(Qt::WaitCursor);
QApplication::processEvents();
QElapsedTimer timer;
timer.start();
QString path = m_sSettings->value("LibPath").toString();
QDir Dir(path);
QFileInfoList List = Dir.entryInfoList(QStringList()<<"*.zip");
thread_pool->setMaxThreadCount(12);
foreach(QFileInfo fi, List)
{
auto ret = QtConcurrent::run(aBigZipRun, fi, this);
}
thread_pool->waitForDone();
fillAuthorList();
QMessageBox::information(this, "Заняло времени:", timeConversion(timer.elapsed()));
//fillAuthorList();
QApplication::restoreOverrideCursor();
}
void MainWindow::OnMenuActionUpdateDB()
{
UpdateDB(false);
}
void MainWindow::OnMenuActionRescanDB()
{
UpdateDB(true);
}
void MainWindow::OnMenuActionClearDB()
{
QMessageBox msgBox;
msgBox.setText("Выбранное действие приведет к полной очистке базы данных.");
msgBox.setIcon(QMessageBox::Question);
msgBox.setInformativeText("Вы уверены?");
msgBox.setStandardButtons((QMessageBox::StandardButtons) QMessageBox::No | QMessageBox::Yes);
msgBox.setDefaultButton(QMessageBox::No);
int ret = msgBox.exec();
if(ret == QMessageBox::Yes)
{
SmpLibDatabase* db = SmpLibDatabase::instance(m_sDBFile, m_DbEngine);
db->DropTables();
fillAuthorList();
fillBookList("");
}
}
QString MainWindow::fileChecksum(const QString &fileName,
QCryptographicHash::Algorithm hashAlgorithm)
{
QFile f(fileName);
if (f.open(QFile::ReadOnly)) {
QCryptographicHash hash(hashAlgorithm);
if (hash.addData(&f)) {
return hash.result().toHex();
}
}
return QString("");
}
void MainWindow::OnLineAuthorFindReturnPressed()
{
fillAuthorList(ui->lineAuthorFind->text());
}