*/
void DialogOptions::fillTable(){
int count = m_contextHandlers.list().size();
- ui->tableWidget->setRowCount(count);
+ int rowCount = 0;
+ for (int row = 0; row < count; row++){
+ ContextHandler* handler = m_contextHandlers.list().at(row);
+ if (handler->intrinsicType() == ContextHandler::IT_UNDEF)
+ rowCount++;
+ }
+ ui->tableWidget->setRowCount(rowCount);
QString value;
QList < QString > dirMode;
- for (int row = 0; row < count; row++){
+ for (int row = 0; row < rowCount; row++){
ContextHandler* handler = m_contextHandlers.list().at(row);
if (handler->intrinsicType() == ContextHandler::IT_UNDEF){
ui->tableWidget->setItem(row, COL_TITLE,
*/
void DialogOptions::fromTable(){
m_contextHandlers.clear();
- for (int row = 0; row < ui->tableWidget->rowCount(); row++){
+ int count = ui->tableWidget->rowCount();
+ for (int row = 0; row < count; row++){
ContextHandler* handler = new ContextHandler;
fillContextHandler(row, *handler);
m_contextHandlers.list().append(handler);
*
* @param row the row number
* @param withNode true: the node will be appended to the result
+ * @param uriFormat true: example: file:///u:/tmp/file.txt<br>
+ * false: example: u:\tmp\file.txt
* @return the absolute path of the file given by the row
*/
-QString MainWindow::buildAbsPath(int row, bool withNode){
+QString MainWindow::buildAbsPath(int row, bool withNode, bool uriFormat){
QString rc(m_lastBaseDir.absolutePath());
QString value = cellAsText(row, TC_PATH);
if (!value.isEmpty()){
ReQStringUtil::ensureLastChar(rc, '/');
rc += cellAsText(row, TC_NODE);
}
+ if (uriFormat){
+ rc = "file://" + rc;
+#if defined WIN32
+ rc = rc.replace('\\', '/');
+#endif
+ }
return rc;
}
rc |= QDir::Dirs | QDir::Files;
if (!ui->checkBoxLinks->isChecked())
rc |= QDir::NoSymLinks;
- if (ui->checkBoxHidden)
- rc |= QDir::Hidden | QDir::System;
- QDir::Filters mask = 0;
- if (ui->checkBoxWritable->isChecked())
- mask |= QDir::Writable;
- if (ui->checkBoxReadable->isChecked())
- mask |= QDir::Readable;
- if (ui->checkBoxExecutable->isChecked())
- mask |= QDir::Executable;
- if (mask == 0)
- mask |= QDir::PermissionMask;
- rc |= mask;
return rc;
}
for (it = ranges.begin(); it != ranges.end(); ++it){
for (int row = (*it).topRow(); row <= (*it).bottomRow(); row++){
isDir = cellAsText(row, TC_SIZE).isEmpty();
- QUrl url(buildAbsPath(row, true));
+ QUrl url(buildAbsPath(row, true, true));
urls.append(url);
if (isDir)
dirs++;
ui->checkBoxBinaryFiles->setChecked(false);
ui->checkBoxDirs->setChecked(true);
ui->checkBoxFiles->setChecked(true);
-ui->checkBoxHidden->setChecked(false);
ui->checkBoxLinks->setChecked(true);
-ui->checkBoxReadable->setChecked(true);
ui->checkBoxRegExpr->setChecked(false);
ui->checkBoxTextIgnoreCase->setChecked(false);
-ui->checkBoxWritable->setChecked(true);
-ui->checkBoxExecutable->setChecked(true);
}
/**
~MainWindow();
public:
- void fileDragging();private slots:
+ void fileDragging();
+private slots:
void about();
void absPathToClipboard();
void baseDirToClipboard();
private:
void prepareContextMenu();
- QString buildAbsPath(int row, bool withNode = false);
+ QString buildAbsPath(int row, bool withNode = false, bool uriFormat = false);
QDir::Filters buildFileTypes();
void buildGlobalPlaceholders(QMap <QString, QString>& hash);
QString cellAsText(int row, int col);