Commit 822631ed authored by Sandy Meier's avatar Sandy Meier

*** empty log message ***

parent d1ff3804
1999-06-14 The KDevelop Team
* KDevelop 0.4 released
1999-06-14 Sandy Meier <smeier@rz.uni-potsdam.de>
* commit patch by Walter Tasin
1999-06-13 Stefan Heidrich <sheidric@rz.uni-potsdam.de>
* fixed the directory bug in the applikation wizard
......
......@@ -87,10 +87,10 @@ AC_MSG_WARN("We are very sorry for this problem but I am sure")
AC_MSG_WARN("we can fix it until the 0.4.1 release. If you are")
AC_MSG_WARN("not successfull in building the dialog loader")
AC_MSG_WARN("please write to the kdevelop mailing list not")
AC_MSG_WARN("the the developers.")
AC_MSG_WARN("to the developers.")
AC_MSG_WARN("")
AC_MSG_WARN("Have a lot of fun")
AC_MSG_WARN("")
AC_MSG_WARN("Pascal Krahmer")
AC_MSG_WARN("Pascal Krahmer/The KDevelop Team")
AC_MSG_WARN("**************************************************")
......@@ -90,8 +90,20 @@ void CDocBrowser::slotViewInKFM(){
void CDocBrowser::showURL(QString url,bool reload){
//read the htmlfile
//cerr << "URL:" << url << "\n";
QString url_wo_ref=url; // without ref
QString ref;
if(url.left(7) == "http://"){
complete_url=url;
int pos = url.findRev('#');
int len = url.length();
ref = (pos!=-1) ? (const char*) url.right(len - pos - 1) : "";
m_refTitle = ref;
if (pos!=-1)
url_wo_ref = url.left(pos);
if(url.left(7) == "http://" || url_wo_ref.right(4).find("htm", FALSE)==-1){
KProcess showHTML;
showHTML << "kfmclient" << "openURL" << url;
......@@ -104,39 +116,32 @@ void CDocBrowser::showURL(QString url,bool reload){
htmlview=getKHTMLWidget();
// htmlview->setCursor( KCursor::waitCursor() );
QString ref = url;
QString url_wo_ref; // without ref
int pos = ref.findRev('#');
int len = ref.length();
ref = ref.right(len - pos - 1);
pos = url.findRev('#');
url_wo_ref = url.left(pos);
if( (url_wo_ref != old_url) || reload){
QString str="";
KFM::download(url,str);
//cerr << endl << "STR:" << str;
char buffer[256];
int val;
char buffer[256+1];
QFile file(str) ;
if(file.exists()){
emit enableStop(ID_HELP_BROWSER_STOP);
emit enableStop(ID_HELP_BROWSER_STOP);
file.open(IO_ReadOnly);
QDataStream dstream ( &file );
QString content;
begin( url);
do
{
buffer[0] = '\0';
val = file.readLine( buffer, 256 );
write(buffer);
}
while ( !file.atEnd() );
while ( !dstream.eof() )
{
buffer[256]='\0';
dstream.readRawBytes(buffer, 256);
write(buffer);
}
end();
parse();
show();
show();
KFM::removeTempFile(str);
file.close();
}
......@@ -148,18 +153,27 @@ void CDocBrowser::showURL(QString url,bool reload){
}
if (pos != -1){
gotoAnchor(ref);
}
else
{
if (url_wo_ref == old_url)
gotoXY(0,0);
}
if (url_wo_ref == old_url)
{
emit documentDone(this); // simulate documentDone to put it in history...
}
old_url = url_wo_ref;
}
QString CDocBrowser::currentURL(){
return url;
return complete_url;
}
void CDocBrowser::setDocBrowserOptions(){
void CDocBrowser::setDocBrowserOptions(){
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup( "DocBrowserAppearance" );
......@@ -197,6 +211,7 @@ void CDocBrowser::slotDocFontSize(int size){
fSize = size;
htmlview->setDefaultFontBase( size );
htmlview->parse();
showURL(complete_url, true);
// busy = true;
// emit enableMenuItems();
}
......@@ -207,6 +222,7 @@ void CDocBrowser::slotDocStandardFont(const char* n){
standardFont = n;
htmlview->setStandardFont( n );
htmlview->parse();
showURL(complete_url, true);
// busy = true;
// emit enableMenuItems();
}
......@@ -217,6 +233,7 @@ void CDocBrowser::slotDocFixedFont(const char* n){
fixedFont = n;
htmlview->setFixedFont( n );
htmlview->parse();
showURL(complete_url, true);
// busy = true;
// emit enableMenuItems();
}
......@@ -231,6 +248,7 @@ void CDocBrowser::slotDocColorsChanged( const QColor &bg, const QColor &text,
htmlview->setDefaultTextColors( text, link, vlink );
htmlview->setUnderlineLinks(uline);
htmlview->parse();
showURL(complete_url, true);
// busy = true;
// emit enableMenuItems();){
}
......@@ -291,7 +309,7 @@ void CDocBrowser::slotSetFileTitle( const char* title ){
}
QString CDocBrowser::currentTitle(){
return m_title;
return (m_refTitle.isEmpty()) ? m_title : m_refTitle+" - "+m_title;
}
//
// KDE Help Options
......
......@@ -75,8 +75,8 @@ public slots:
void signalBookmarkAdd();
void enableStop(int);
protected:
QString old_url;
QString m_title;
QString old_url, complete_url;
QString m_title, m_refTitle;
// void mousePressEvent(QMouseEvent* event);
QPopupMenu* doc_pop;
......
......@@ -1260,6 +1260,7 @@ void CKDevelop::slotHelpSearchText(){
text = edit_widget->currentWord();
}
}
text.replace(QRegExp("\n$"), ""); // strip last \n
slotHelpSearchText(text);
}
......@@ -1644,27 +1645,34 @@ void CKDevelop::slotURLonURL(KHTMLView*, const char *url )
void CKDevelop::slotDocumentDone( KHTMLView *_view ){
QString actualURL=browser_widget->currentURL();
QString actualTitle=browser_widget->currentTitle();
int cur = history_list.at()+1; // get the current index
int found = history_list.find(actualURL); // get the current index
int pos = actualURL.findRev('#');
QString url_wo_ref=actualURL; // without ref
if(prev_was_search_result){
browser_widget->findTextBegin();
browser_widget->findTextNext(QRegExp(doc_search_text));
}
setCaption(browser_widget->currentTitle()+" - KDevelop " + version);
setCaption(actualTitle+" - KDevelop " + version);
if (pos!=-1)
url_wo_ref = actualURL.left(pos);
// insert into the history-list
if(actualURL.left(7) != "http://"){ // http aren't added to the history list
if(actualURL.left(7) != "http://" || url_wo_ref.right(4).find("htm", FALSE)==-1){
// http aren't added to the history list
if (found == -1)
{
if(cur == 0 ){
history_list.append(actualURL);
history_title_list.append(browser_widget->currentTitle());
history_title_list.append(actualTitle);
}
else{
history_list.insert(cur,actualURL);
history_title_list.insert(cur, browser_widget->currentTitle());
history_title_list.insert(cur, actualTitle);
}
}
else
......@@ -1672,7 +1680,7 @@ void CKDevelop::slotDocumentDone( KHTMLView *_view ){
// the desired URL was already found in the list
if (actualURL.contains("kdevelop/search_result.html") &&
history_title_list.at(found)!=browser_widget->currentTitle())
history_title_list.at(found)!=actualTitle)
{
// this means... a new search_result.html is selected and an old one
// was found in list
......@@ -1682,7 +1690,7 @@ void CKDevelop::slotDocumentDone( KHTMLView *_view ){
// append now the new one
cur=history_list.count();
history_list.insert(cur,actualURL);
history_title_list.insert(cur, browser_widget->currentTitle());
history_title_list.insert(cur, actualTitle);
}
else
if (prev_was_search_result)
......@@ -1695,7 +1703,7 @@ void CKDevelop::slotDocumentDone( KHTMLView *_view ){
if (found<cur)
cur--;
history_list.insert(cur,actualURL);
history_title_list.insert(cur, browser_widget->currentTitle());
history_title_list.insert(cur, actualTitle);
}
else
{
......
......@@ -85,7 +85,7 @@ public:
/**constructor*/
CKDevelop();
/**destructor*/
~CKDevelop(){};
virtual ~CKDevelop();
void initView();
void initConnections();
void initKeyAccel();
......
......@@ -61,6 +61,12 @@ CKDevelop::CKDevelop(){
slotStatusMsg(i18n("Welcome to KDevelop!"));
}
CKDevelop::~CKDevelop(){
// from Constructur... delete everything which is not constructed
// with a binding to the application
delete error_parser;
}
void CKDevelop::initView(){
act_outbuffer_len=0;
prj = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment