From 925c888ad175f4f97d4d7bbb7f071a8a2d8a9cbd Mon Sep 17 00:00:00 2001 From: Francisco Ballina Date: Sat, 26 Oct 2013 22:48:06 -0500 Subject: [PATCH] Add a method for get working directory in class QTermWidget --- CMakeLists.txt.user | 151 ++++++++++++++++++++++++++++++++++++++++++++ lib/qtermwidget.cpp | 9 ++- lib/qtermwidget.h | 1 + 3 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt.user diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 index 0000000..2ef847a --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,151 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + true + 1 + true + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {097b390d-dc62-470a-bc7b-0d9e416e1f16} + 0 + 0 + 0 + + /home/francisco/Documentos/Desarrollo/qtermwidget-build + false + + + + + all + + false + false + true + Make + + CMakeProjectManager.MakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + clean + + true + false + true + Make + + CMakeProjectManager.MakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + all + + CMakeProjectManager.CMakeBuildConfiguration + + 1 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + test + + false + + 2 + + test + + CMakeProjectManager.CMakeRunConfiguration.test + 3768 + true + false + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {a71fb8cb-cc43-4b98-84d7-c849723ed474} + + + ProjectExplorer.Project.Updater.FileVersion + 14 + + diff --git a/lib/qtermwidget.cpp b/lib/qtermwidget.cpp index fc23f2b..f9b00d9 100644 --- a/lib/qtermwidget.cpp +++ b/lib/qtermwidget.cpp @@ -33,7 +33,7 @@ #include "ColorScheme.h" #include "SearchBar.h" -#define STEP_ZOOM 3 +#define STEP_ZOOM 1 using namespace Konsole; @@ -322,6 +322,13 @@ void QTermWidget::setWorkingDirectory(const QString& dir) m_impl->m_session->setInitialWorkingDirectory(dir); } +QString QTermWidget::workingDirectory() +{ + if (!m_impl->m_session) + return QString(); + return m_impl->m_session->initialWorkingDirectory(); +} + void QTermWidget::setArgs(QStringList &args) { if (!m_impl->m_session) diff --git a/lib/qtermwidget.h b/lib/qtermwidget.h index 89cd82b..ada584d 100644 --- a/lib/qtermwidget.h +++ b/lib/qtermwidget.h @@ -75,6 +75,7 @@ public: //working directory void setWorkingDirectory(const QString & dir); + QString workingDirectory(); // Shell program args, default is none void setArgs(QStringList & args);