Skip to content

Commit

Permalink
modify empty function, refresh time in projectView
Browse files Browse the repository at this point in the history
  • Loading branch information
yodalee committed Jan 28, 2015
1 parent c72c7fd commit 1516b4f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
5 changes: 2 additions & 3 deletions qucs/qucs/projectView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ProjectView::~ProjectView()
void
ProjectView::setProjPath(const QString &path)
{
m_valid = QDir(path).exists();
m_valid = !path.isEmpty() && QDir(path).exists();

if (m_valid) {
//test path exist
Expand All @@ -67,9 +67,8 @@ ProjectView::setProjPath(const QString &path)
m_projName = m_projName.mid(i+1); // cut out the last subdirectory
}
m_projName.remove("_prj");

refresh();
}
refresh();
}

// refresh using projectPath
Expand Down
25 changes: 3 additions & 22 deletions qucs/qucs/qucs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ QucsApp::~QucsApp()
// ########## Creates the working area (QTabWidget etc.) ##########
// ########## ##########
// #######################################################################
void QucsApp::initContentListView()
{
}

/**
* @brief QucsApp::initView Setup the layour of all widgets
*/
Expand Down Expand Up @@ -1123,17 +1119,6 @@ void QucsApp::slotButtonProjNew()
}
}

// ----------------------------------------------------------
// Reads all files in the project directory and sort them into the
// content ListView
void QucsApp::readProjectFiles()
{
//Is this OK instead of the above??
initContentListView();

slotUpdateTreeview();
}

// ----------------------------------------------------------
// Opens an existing project.
void QucsApp::openProject(const QString& Path)
Expand Down Expand Up @@ -1165,9 +1150,6 @@ void QucsApp::openProject(const QString& Path)

Content->setProjPath(QucsSettings.QucsWorkDir.absolutePath());

QStringList headers;
readProjectFiles();

TabView->setCurrentPage(1); // switch to "Content"-Tab
ProjName = Name; // remember the name of project

Expand Down Expand Up @@ -1226,8 +1208,7 @@ void QucsApp::slotMenuProjClose()
QucsSettings.QucsWorkDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
octave->adjustDirectory();

QStringList headers;
initContentListView();
Content->setProjPath("");

TabView->setCurrentPage(0); // switch to "Projects"-Tab
ProjName = "";
Expand Down Expand Up @@ -1453,7 +1434,7 @@ void QucsApp::slotFileSave()
statusBar()->message(tr("Ready."));

if(!ProjName.isEmpty())
readProjectFiles(); // re-read the content ListView
slotUpdateTreeview();
}

// --------------------------------------------------------------
Expand Down Expand Up @@ -1565,7 +1546,7 @@ void QucsApp::slotFileSaveAs()
this->updateSpiceNameHash();

if(!ProjName.isEmpty())
readProjectFiles(); // re-read the content ListView
slotUpdateTreeview();
}


Expand Down
2 changes: 0 additions & 2 deletions qucs/qucs/qucs.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ private slots:
// ********** Methods ***************************************************
void initView();
void initCursorMenu();
void initContentListView();

void printCurrentDocument(bool);
bool saveFile(QucsDoc *Doc=0);
Expand All @@ -226,7 +225,6 @@ private slots:
public:

void readProjects();
void readProjectFiles();
void updatePathList(void); // update the list of paths, pruning non-existing paths
void updatePathList(QStringList);
void updateSchNameHash(void); // maps all schematic files in the path list
Expand Down
4 changes: 2 additions & 2 deletions qucs/qucs/qucs_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ void QucsApp::slotAddToProject()
}

free(Buffer);
readProjectFiles(); // re-read the content ListView
slotUpdateTreeview();
statusBar()->message(tr("Ready."));
}

Expand Down Expand Up @@ -1257,7 +1257,7 @@ void QucsApp::slotImportData()

ImportDialog *d = new ImportDialog(this);
if(d->exec() == QDialog::Accepted)
readProjectFiles(); // re-read all project files
slotUpdateTreeview();
}

// -----------------------------------------------------------
Expand Down

0 comments on commit 1516b4f

Please sign in to comment.