QTableWidgetItem *item = vmInfoTable->item(nRow, 0);
qDebug() << item->text() << "item was double clicked";
+ QString path = "";
+
if (item->text().compare(DETAILED_INFO_HDS_PATH) == 0 ||
item->text().compare(DETAILED_INFO_EMUL_LOG_FILE) == 0 ||
item->text().compare(DETAILED_INFO_KERNEL_LOG_FILE) == 0 ||
item->text().compare(DETAILED_INFO_DRIVE_IMAGE_FILE) == 0 ||
item->text().compare(DETAILED_INFO_SWAP_IMAGE_FILE) == 0 ||
item->text().compare(DETAILED_INFO_KERNEL_FILE) == 0) {
+ qDebug("open the specified path");
+
/* get path item */
item = vmInfoTable->item(nRow, nCol);
if (item->text().compare(GENERIC_TEXT_NONE) == 0 ||
item->text().isEmpty() == true) {
/* ignore this event */
+ qWarning("specified path is empty");
+ return;
+ }
+
+ path = item->text();
+ } else if (item->text().compare(DETAILED_INFO_SKIN_NAME) == 0) {
+ qDebug("open the skin path");
+
+ /* skin name item */
+ if (win->getUiInfo()->getSkinPath().isEmpty() == true) {
+ /* ignore this event */
+ qWarning("specified skin path is empty");
return;
}
+
+ path = win->getUiInfo()->getSkinPath();
} else {
/* ignore this event */
+ qDebug("do nothing");
return;
}
- QFileInfo pathInfo(item->text());
+ QFileInfo pathInfo(path);
if (pathInfo.isDir() == true) {
/* directory path */
- QDesktopServices::openUrl(
- QUrl("file:///" + item->text(), QUrl::TolerantMode));
+ if (QDesktopServices::openUrl(
+ QUrl("file:///" + path, QUrl::TolerantMode)) == false) {
+ qWarning() << "cannot open the path:" + path;
+ return;
+ }
} else if (pathInfo.isFile() == true) {
/* file path */
- QDesktopServices::openUrl(
- QUrl("file:///" + pathInfo.absolutePath(), QUrl::TolerantMode));
+ if (QDesktopServices::openUrl(
+ QUrl("file:///" + pathInfo.absolutePath(), QUrl::TolerantMode)) == false) {
+ qWarning() << "cannot open the file:" + pathInfo.absolutePath();
+ return;
+ }
} else {
- qWarning() << "invalid path info:" << item->text();
+ qWarning() << "invalid path info:" << path;
}
}