调整配置文件名
This commit is contained in:
parent
6c4ea84b5b
commit
f6e1c03277
|
@ -284,15 +284,9 @@ public:
|
|||
{
|
||||
root_dir_ = std::string(root) + PATH_SYMBOL;
|
||||
}
|
||||
void add_scanner(const char* sane_name, int pid)
|
||||
void add_scanner(const char* sane_name)
|
||||
{
|
||||
char buf[10] = { 0 };
|
||||
sprintf(buf, "%x", pid);
|
||||
std::string devName = sane_name;
|
||||
if (pid != 0)
|
||||
{
|
||||
devName = devName.substr(0, devName.find(" - ")) + " - " + buf;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
|
||||
|
|
|
@ -56,8 +56,15 @@ hg_settingdialog::hg_settingdialog(SANE_Handle handle, const SANEAPI* saneApi, b
|
|||
int pid = 0;
|
||||
saneApi->sane_control_option_api(m_devHandle, (SANE_Int)0x8853, SANE_ACTION_GET_VALUE, &pid, NULL);
|
||||
|
||||
dev_que_.add_scanner(devName, pid);
|
||||
dev_que_.open_scanner(saneApi, handle, devName, false);
|
||||
char buf[10] = { 0 };
|
||||
sprintf(buf, "%x", pid);
|
||||
std::string deviceName = m_devName;
|
||||
if (pid != 0)
|
||||
{
|
||||
deviceName = deviceName.substr(0, deviceName.find(" ")) + " " + buf;
|
||||
}
|
||||
dev_que_.add_scanner(deviceName.c_str());
|
||||
dev_que_.open_scanner(saneApi, handle, deviceName.c_str(), false);
|
||||
|
||||
std::string n(dev_que_.opened_scanner_name());
|
||||
for(int i = 0; i < dev_que_.scanners(); ++i)
|
||||
|
|
|
@ -63,13 +63,19 @@ char *apply_current_config(const char *dev_name, SANE_Handle device, LPSANEAPI a
|
|||
if(QFile::exists(old))
|
||||
dev_que::update_old_cfg(old.toStdString().c_str());
|
||||
|
||||
std::string devName = dev_name;
|
||||
|
||||
int pid = 0;
|
||||
api->sane_control_option_api(device, (SANE_Int)0x8853, SANE_ACTION_GET_VALUE, &pid, NULL);
|
||||
|
||||
devQue.add_scanner(devName.c_str(), pid);
|
||||
devQue.open_scanner(api, device, dev_name, true);
|
||||
char buf[10] = { 0 };
|
||||
sprintf(buf, "%x", pid);
|
||||
std::string devName = dev_name;
|
||||
if (pid != 0)
|
||||
{
|
||||
devName = devName.substr(0, devName.find(" ")) + " " + buf;
|
||||
}
|
||||
|
||||
devQue.add_scanner(devName.c_str());
|
||||
devQue.open_scanner(api, device, devName.c_str(), true);
|
||||
|
||||
std::string n(devQue.opened_scanner_name());
|
||||
for(int i = 0; i < devQue.scanners(); ++i)
|
||||
|
|
Loading…
Reference in New Issue