|
a/dirbrowser/cdbrowser.cpp |
|
b/dirbrowser/cdbrowser.cpp |
|
... |
|
... |
137 |
//qDebug() << "CDBrowser::mouseReleaseEvent";
|
137 |
//qDebug() << "CDBrowser::mouseReleaseEvent";
|
138 |
m_lastbutton = event->button();
|
138 |
m_lastbutton = event->button();
|
139 |
QWEBVIEW::mouseReleaseEvent(event);
|
139 |
QWEBVIEW::mouseReleaseEvent(event);
|
140 |
}
|
140 |
}
|
141 |
|
141 |
|
|
|
142 |
// Alphabetic key presses have the same effect as clicking one of the
|
|
|
143 |
// alphabet links.
|
|
|
144 |
void CDBrowser::keyPressEvent(QKeyEvent *e)
|
|
|
145 |
{
|
|
|
146 |
/* We happen to know that the Key_X event value is the ascii character */
|
|
|
147 |
unsigned char val =(unsigned char)e->key();
|
|
|
148 |
if (val >= 'A' && val <= 'Z') {
|
|
|
149 |
QString surl("http://h/a");
|
|
|
150 |
surl += QString(val);
|
|
|
151 |
QUrl url(surl);
|
|
|
152 |
onLinkClicked(url);
|
|
|
153 |
}
|
|
|
154 |
QWEBVIEW::keyPressEvent(e);
|
|
|
155 |
}
|
|
|
156 |
|
142 |
void CDBrowser::onContentsSizeChanged(const QSize&)
|
157 |
void CDBrowser::onContentsSizeChanged(const QSize&)
|
143 |
{
|
158 |
{
|
144 |
//qDebug() << "CDBrowser::onContentsSizeChanged: scrollpos " <<
|
159 |
//qDebug() << "CDBrowser::onContentsSizeChanged: scrollpos " <<
|
145 |
// page()->mainFrame()->scrollPosition();
|
160 |
// page()->mainFrame()->scrollPosition();
|
146 |
#ifndef USING_WEBENGINE
|
161 |
#ifndef USING_WEBENGINE
|
|
... |
|
... |
295 |
if (scurl.find("http://h/") != 0) {
|
310 |
if (scurl.find("http://h/") != 0) {
|
296 |
qDebug() << "CDBrowser::onLinkClicked: bad link ! : " << url.toString();
|
311 |
qDebug() << "CDBrowser::onLinkClicked: bad link ! : " << url.toString();
|
297 |
return;
|
312 |
return;
|
298 |
}
|
313 |
}
|
299 |
scurl = scurl.substr(9);
|
314 |
scurl = scurl.substr(9);
|
300 |
LOGDEB("CDBrowser::onLinkClicked: corrected url: [" << scurl << "]" <<endl);
|
315 |
qDebug() << "CDBrowser::onLinkClicked: corrected url: " << scurl.c_str();;
|
301 |
|
316 |
|
302 |
int what = scurl[0];
|
317 |
int what = scurl[0];
|
303 |
|
318 |
|
304 |
switch (what) {
|
319 |
switch (what) {
|
305 |
|
320 |
|