• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IJHack / QtPass / 27662039065

17 Jun 2026 02:37AM UTC coverage: 57.501% (+0.02%) from 57.477%
27662039065

Pull #1551

github

web-flow
Merge 0dec3edf7 into 4da97561f
Pull Request #1551: refactor(pass): inject AppSettings into Pass hierarchy (PR A of #1511)

52 of 92 new or added lines in 6 files covered. (56.52%)

13 existing lines in 6 files now uncovered.

3990 of 6939 relevant lines covered (57.5%)

23.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.24
/src/passbackendfactory.cpp
1
// SPDX-FileCopyrightText: 2016 Anne Jan Brouwer
2
// SPDX-License-Identifier: GPL-3.0-or-later
3

4
/**
5
 * @class PassBackendFactory
6
 * @brief Pass backend lifecycle implementation.
7
 *
8
 * @see passbackendfactory.h
9
 */
10

11
#include "passbackendfactory.h"
12
#include "appsettings.h"
13
#include "pass.h"
14
#include "qtpasssettings.h"
15

16
#include <QDir>
17

18
Pass *PassBackendFactory::pass = nullptr;
19
QScopedPointer<RealPass> PassBackendFactory::realPass;
20
QScopedPointer<ImitatePass> PassBackendFactory::imitatePass;
21

22
auto PassBackendFactory::getPass() -> Pass * {
41✔
23
  if (!pass) {
41✔
24
    AppSettings s = QtPassSettings::load();
13✔
25
    // Ensure store directory exists (first-run side effect — load() normalises
26
    // the path but does not create the directory).
27
    if (!QDir(s.passStore).exists())
13✔
28
      QDir().mkdir(s.passStore);
2✔
29
    if (s.usePass) {
13✔
UNCOV
30
      pass = getRealPass();
×
31
    } else {
32
      pass = getImitatePass();
13✔
33
    }
34
    if (pass) {
13✔
35
      pass->init(s);
13✔
36
    }
37
  }
13✔
38
  return pass;
41✔
39
}
40

41
auto PassBackendFactory::getRealPass() -> RealPass * {
12✔
42
  if (realPass.isNull()) {
12✔
43
    realPass.reset(new RealPass());
1✔
44
  }
45
  return realPass.data();
12✔
46
}
47

48
auto PassBackendFactory::getImitatePass() -> ImitatePass * {
49✔
49
  if (imitatePass.isNull()) {
49✔
50
    imitatePass.reset(new ImitatePass());
2✔
51
  }
52
  return imitatePass.data();
49✔
53
}
54

55
void PassBackendFactory::invalidate() { pass = nullptr; }
19✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc