Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename from "StorageBookmark" to "Bookmark", and change the Type from…
… {Storage / Bookmark} to {System / User}.(refs #79)
- Loading branch information
Showing
12 changed files
with
264 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef BOOKMARKINFO_H | ||
#define BOOKMARKINFO_H | ||
|
||
#include <QString> | ||
|
||
namespace Farman | ||
{ | ||
|
||
// ブックマーク情報 | ||
class BookmarkInfo | ||
{ | ||
public: | ||
enum class Type : int | ||
{ | ||
System, | ||
User, | ||
}; | ||
|
||
BookmarkInfo(Type type, const QString& name, const QString& path) | ||
{ | ||
m_type = type; | ||
m_name = name; | ||
m_path = path; | ||
} | ||
|
||
~BookmarkInfo() = default; | ||
|
||
Type getType() const { return m_type; } | ||
QString getTypeName() const { return (m_type == Type::System) ? "System" : (m_type == Type::User) ? "User" : "Unknown"; } | ||
QString getName() const { return m_name; } | ||
QString getPath() const { return m_path; } | ||
|
||
private: | ||
BookmarkInfo() = delete; | ||
|
||
Type m_type; | ||
QString m_name; | ||
QString m_path; | ||
}; | ||
|
||
} // namespace Farman | ||
|
||
#endif // BOOKMARKINFO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <QStorageInfo> | ||
#include "selectbookmarkdialog.h" | ||
#include "ui_selectbookmarkdialog.h" | ||
|
||
namespace Farman | ||
{ | ||
|
||
SelectBookmarkDialog::SelectBookmarkDialog(QWidget *parent/* = Q_NULLPTR*/) : | ||
QDialog(parent), | ||
ui(new Ui::SelectBookmarkDialog), | ||
m_bookmarkInfoModel(new BookmarkInfoModel()) | ||
{ | ||
ui->setupUi(this); | ||
|
||
ui->bookmarksTableView->setModel(m_bookmarkInfoModel); | ||
ui->bookmarksTableView->setCurrentIndex(m_bookmarkInfoModel->index(0, 0)); | ||
|
||
ui->bookmarksTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); | ||
} | ||
|
||
SelectBookmarkDialog::~SelectBookmarkDialog() | ||
{ | ||
delete m_bookmarkInfoModel; | ||
|
||
delete ui; | ||
} | ||
|
||
void SelectBookmarkDialog::accept() | ||
{ | ||
m_selectedPath = m_bookmarkInfoModel->data(ui->bookmarksTableView->currentIndex(), BookmarkInfoModel::PathRole).toString(); | ||
|
||
QDialog::accept(); | ||
} | ||
|
||
} // namespace Farman |
Oops, something went wrong.