Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executeing pass show before editpassword dialog shows up #254

Merged
merged 3 commits into from
Dec 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ int Executor::executeBlocking(QString app, const QStringList &args,
QTextCodec *codec = QTextCodec::codecForLocale();
QString pout = codec->toUnicode(internal.readAllStandardOutput());
QString perr = codec->toUnicode(internal.readAllStandardError());
if (process_out != nullptr)
if (process_out != Q_NULLPTR)
*process_out = pout;
if (process_err != nullptr)
if (process_err != Q_NULLPTR)
*process_err = perr;
emit finished(internal.exitCode(), pout, perr);
return internal.exitCode();
Expand Down
6 changes: 3 additions & 3 deletions executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ class Executor : public QObject {
bool readStdout = false, bool readStderr = true);

int executeBlocking(QString app, const QStringList &args,
QString input = QString(), QString *process_out = nullptr,
QString *process_err = nullptr);
QString input = QString(), QString *process_out = Q_NULLPTR,
QString *process_err = Q_NULLPTR);

int executeBlocking(QString app, const QStringList &args,
QString *process_out, QString *process_err = nullptr);
QString *process_out, QString *process_err = Q_NULLPTR);

void setEnvironment(const QStringList &env);
private slots:
Expand Down
3 changes: 1 addition & 2 deletions imitatepass.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "imitatepass.h"
#include "debughelper.h"
#include "mainwindow.h"
#include "qtpasssettings.h"

/**
Expand Down Expand Up @@ -239,7 +238,7 @@ bool ImitatePass::removeDir(const QString &dirName) {
}

/**
* @brief MainWindow::reencryptPath reencrypt all files under the chosen
* @brief ImitatePass::reencryptPath reencrypt all files under the chosen
* directory
*
* This is stil quite experimental..
Expand Down
18 changes: 9 additions & 9 deletions imitatepass.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ class ImitatePass : public Pass {
public:
ImitatePass();
virtual ~ImitatePass() {}
virtual void GitInit() override;
virtual void GitPull() override;
virtual void GitPull_b() override;
virtual void GitPush() override;
virtual void Show(QString file) override;
virtual int Show_b(QString file) override;
virtual void GitInit() Q_DECL_OVERRIDE;
virtual void GitPull() Q_DECL_OVERRIDE;
virtual void GitPull_b() Q_DECL_OVERRIDE;
virtual void GitPush() Q_DECL_OVERRIDE;
virtual void Show(QString file) Q_DECL_OVERRIDE;
virtual int Show_b(QString file) Q_DECL_OVERRIDE;
virtual void Insert(QString file, QString value,
bool overwrite = false) override;
virtual void Remove(QString file, bool isDir = false) override;
virtual void Init(QString path, const QList<UserInfo> &list) override;
bool overwrite = false) Q_DECL_OVERRIDE;
virtual void Remove(QString file, bool isDir = false) Q_DECL_OVERRIDE;
virtual void Init(QString path, const QList<UserInfo> &list) Q_DECL_OVERRIDE;

void reencryptPath(QString dir);
signals:
Expand Down
5 changes: 3 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow), fusedav(this), keygen(NULL),
tray(NULL), pass(nullptr) {
tray(NULL), pass(Q_NULLPTR) {
// TODO(bezet): this should be reconnected dynamically when pass changes
connect(&rpass, SIGNAL(error(QProcess::ProcessError)), this,
SLOT(processError(QProcess::ProcessError)));
Expand Down Expand Up @@ -346,7 +346,7 @@ bool MainWindow::checkConfig() {
updateProfileBox();

// TODO(bezet): make this check unnecessary
if (pass == nullptr) {
if (pass == Q_NULLPTR) {
if (QtPassSettings::isUsePass())
pass = &rpass;
else
Expand Down Expand Up @@ -964,6 +964,7 @@ QModelIndex MainWindow::firstFile(QModelIndex parentIndex) {
* @param isNew insert (not update)
*/
void MainWindow::setPassword(QString file, bool overwrite, bool isNew = false) {
pass->Show_b(file);
if (!isNew && lastDecrypt.isEmpty()) {
// warn?
return;
Expand Down
18 changes: 9 additions & 9 deletions realpass.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ class RealPass : public Pass {
public:
RealPass();
virtual ~RealPass() {}
virtual void GitInit() override;
virtual void GitPull() override;
virtual void GitPull_b() override;
virtual void GitPush() override;
virtual void Show(QString file) override;
virtual int Show_b(QString file) override;
virtual void GitInit() Q_DECL_OVERRIDE;
virtual void GitPull() Q_DECL_OVERRIDE;
virtual void GitPull_b() Q_DECL_OVERRIDE;
virtual void GitPush() Q_DECL_OVERRIDE;
virtual void Show(QString file) Q_DECL_OVERRIDE;
virtual int Show_b(QString file) Q_DECL_OVERRIDE;
virtual void Insert(QString file, QString value,
bool overwrite = false) override;
virtual void Remove(QString file, bool isDir = false) override;
virtual void Init(QString path, const QList<UserInfo> &users) override;
bool overwrite = false) Q_DECL_OVERRIDE;
virtual void Remove(QString file, bool isDir = false) Q_DECL_OVERRIDE;
virtual void Init(QString path, const QList<UserInfo> &users) Q_DECL_OVERRIDE;
};

#endif // REALPASS_H