Use current directory as dialog start

This commit is contained in:
Stefan Bühler 2012-04-09 12:12:30 +02:00
parent 573e2dd6b6
commit 7a5f0ed60f
2 changed files with 5 additions and 5 deletions

View File

@ -131,7 +131,7 @@ namespace qcross {
//protected: //protected:
void CNewGameDialog::importPackage() { void CNewGameDialog::importPackage() {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select a package to import"), QString fileName = QFileDialog::getOpenFileName(this, tr("Select a package to import"),
QDir::homePath(), tr("QCross Package (*.cpk)")); QString(), tr("QCross Package (*.cpk)"));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
/* if (!File::exists(QCROSS_STRING_DATAPATH)) /* if (!File::exists(QCROSS_STRING_DATAPATH))
QDir::mkpath(QCROSS_STRING_DATAPATH);*/ QDir::mkpath(QCROSS_STRING_DATAPATH);*/
@ -146,7 +146,7 @@ namespace qcross {
void CNewGameDialog::openPictureFile() { void CNewGameDialog::openPictureFile() {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select a picture to open"), QString fileName = QFileDialog::getOpenFileName(this, tr("Select a picture to open"),
QDir::homePath(), tr("Images (*.png *.xpm *.xbm *.jpg)")); QString(), tr("Images (*.png *.xpm *.xbm *.jpg)"));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
if (m_Nonogram) if (m_Nonogram)
delete m_Nonogram; delete m_Nonogram;

View File

@ -119,7 +119,7 @@ namespace qcrossedit {
m_Unsaved = false; m_Unsaved = false;
QString fileName = QFileDialog::getOpenFileName(this, tr("Select a nonogram package to open"), QString fileName = QFileDialog::getOpenFileName(this, tr("Select a nonogram package to open"),
QDir::homePath(), tr("QCross Package (*.cpk)")); QString(), tr("QCross Package (*.cpk)"));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
if (m_Package) if (m_Package)
delete m_Package; delete m_Package;
@ -156,7 +156,7 @@ namespace qcrossedit {
bool CMainWindow::fileSaveAs() { bool CMainWindow::fileSaveAs() {
QString fileName = QFileDialog::getSaveFileName(this, tr("Select a file name for the current package"), QString fileName = QFileDialog::getSaveFileName(this, tr("Select a file name for the current package"),
QDir::homePath(), tr("QCross Package (*.cpk)")); QString(), tr("QCross Package (*.cpk)"));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
if (!QRegExp("*.cpk").exactMatch(fileName)) if (!QRegExp("*.cpk").exactMatch(fileName))
fileName.append(".cpk"); fileName.append(".cpk");
@ -175,7 +175,7 @@ namespace qcrossedit {
void CMainWindow::editCreateFromPicture() { void CMainWindow::editCreateFromPicture() {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select a image file to import"), QString fileName = QFileDialog::getOpenFileName(this, tr("Select a image file to import"),
QDir::homePath(), tr("Images (*.png *.xpm *.xbm *.jpg)")); QString(), tr("Images (*.png *.xpm *.xbm *.jpg)"));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
if (qobject_cast<CCrossPackageModel *>(m_PicListView->model())->appendImage(fileName, QImage(fileName))) if (qobject_cast<CCrossPackageModel *>(m_PicListView->model())->appendImage(fileName, QImage(fileName)))
m_Unsaved = true; m_Unsaved = true;